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
1162      /**
1163       * Filters the search feed link.
1164       *
1165       * @since 2.5.0
1166       *
1167       * @param string $link Search feed link.
1168       * @param string $feed Feed type. Possible values include 'rss2', 'atom'.
1169       * @param string $type The search type. One of 'posts' or 'comments'.
1170       */
1171      return apply_filters( 'search_feed_link', $link, $feed, 'posts' );
1172 }
1173
1174 /**
1175  * Retrieves the permalink for the search results comments feed.
1176  *
1177  * @since 2.5.0
1178  *
1179  * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
1180  *
 
Line Code
1195      $permastruct = $wp_rewrite->get_search_permastruct();
1196
1197      if ( empty( $permastruct ) ) {
1198           $link = add_query_arg( 'feed', 'comments-' . $feed, $link );
1199      } else {
1200           $link = add_query_arg( 'withcomments', 1, $link );
1201      }
1202
1203      /** This filter is documented in wp-includes/link-template.php */
1204      return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
1205 }
1206
1207 /**
1208  * Retrieves the permalink for a post type archive.
1209  *
1210  * @since 3.1.0
1211  * @since 4.5.0 Support for posts was added.
1212  *
1213  * @global WP_Rewrite $wp_rewrite WordPress rewrite component.