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