Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: search_feed_link

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
1240      /**
1241       * Filters the search feed link.
1242       *
1243       * @since 2.5.0
1244       *
1245       * @param string $link Search feed link.
1246       * @param string $feed Feed type. Possible values include 'rss2', 'atom'.
1247       * @param string $type The search type. One of 'posts' or 'comments'.
1248       */
1249      return apply_filters( 'search_feed_link', $link, $feed, 'posts' );
1250 }
1251
1252 /**
1253  * Retrieves the permalink for the search results comments feed.
1254  *
1255  * @since 2.5.0
1256  *
1257  * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
1258  *
 
Line Code
1273      $permastruct = $wp_rewrite->get_search_permastruct();
1274
1275      if ( empty( $permastruct ) ) {
1276           $link = add_query_arg( 'feed', 'comments-' . $feed, $link );
1277      } else {
1278           $link = add_query_arg( 'withcomments', 1, $link );
1279      }
1280
1281      /** This filter is documented in wp-includes/link-template.php */
1282      return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
1283 }
1284
1285 /**
1286  * Retrieves the permalink for a post type archive.
1287  *
1288  * @since 3.1.0
1289  * @since 4.5.0 Support for posts was added.
1290  *
1291  * @global WP_Rewrite $wp_rewrite WordPress rewrite component.