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
1078      /**
1079       * Filters the search feed link.
1080       *
1081       * @since 2.5.0
1082       *
1083       * @param string $link Search feed link.
1084       * @param string $feed Feed type.
1085       * @param string $type The search type. One of 'posts' or 'comments'.
1086       */
1087      return apply_filters( 'search_feed_link', $link, $feed, 'posts' );
1088 }
1089
1090 /**
1091  * Retrieves the permalink for the search results comments feed.
1092  *
1093  * @since 2.5.0
1094  *
1095  * @global WP_Rewrite $wp_rewrite
1096  *
 
Line Code
1108
1109      $permastruct = $wp_rewrite->get_search_permastruct();
1110
1111      if ( empty($permastruct) )
1112           $link = add_query_arg('feed', 'comments-' . $feed, $link);
1113      else
1114           $link = add_query_arg('withcomments', 1, $link);
1115
1116      /** This filter is documented in wp-includes/link-template.php */
1117      return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
1118 }
1119
1120 /**
1121  * Retrieves the permalink for a post type archive.
1122  *
1123  * @since 3.1.0
1124  * @since 4.5.0 Support for posts was added.
1125  *
1126  * @global WP_Rewrite $wp_rewrite