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
1227      /**
1228       * Filters the search feed link.
1229       *
1230       * @since 2.5.0
1231       *
1232       * @param string $link Search feed link.
1233       * @param string $feed Feed type. Possible values include 'rss2', 'atom'.
1234       * @param string $type The search type. One of 'posts' or 'comments'.
1235       */
1236      return apply_filters( 'search_feed_link', $link, $feed, 'posts' );
1237 }
1238
1239 /**
1240  * Retrieves the permalink for the search results comments feed.
1241  *
1242  * @since 2.5.0
1243  *
1244  * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
1245  *
 
Line Code
1260      $permastruct = $wp_rewrite->get_search_permastruct();
1261
1262      if ( empty( $permastruct ) ) {
1263           $link = add_query_arg( 'feed', 'comments-' . $feed, $link );
1264      } else {
1265           $link = add_query_arg( 'withcomments', 1, $link );
1266      }
1267
1268      /** This filter is documented in wp-includes/link-template.php */
1269      return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
1270 }
1271
1272 /**
1273  * Retrieves the permalink for a post type archive.
1274  *
1275  * @since 3.1.0
1276  * @since 4.5.0 Support for posts was added.
1277  *
1278  * @global WP_Rewrite $wp_rewrite WordPress rewrite component.