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
1143      /**
1144       * Filters the search feed link.
1145       *
1146       * @since 2.5.0
1147       *
1148       * @param string $link Search feed link.
1149       * @param string $feed Feed type.
1150       * @param string $type The search type. One of 'posts' or 'comments'.
1151       */
1152      return apply_filters( 'search_feed_link', $link, $feed, 'posts' );
1153 }
1154
1155 /**
1156  * Retrieves the permalink for the search results comments feed.
1157  *
1158  * @since 2.5.0
1159  *
1160  * @global WP_Rewrite $wp_rewrite
1161  *
 
Line Code
1175      $permastruct = $wp_rewrite->get_search_permastruct();
1176
1177      if ( empty( $permastruct ) ) {
1178           $link = add_query_arg( 'feed', 'comments-' . $feed, $link );
1179      } else {
1180           $link = add_query_arg( 'withcomments', 1, $link );
1181      }
1182
1183      /** This filter is documented in wp-includes/link-template.php */
1184      return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
1185 }
1186
1187 /**
1188  * Retrieves the permalink for a post type archive.
1189  *
1190  * @since 3.1.0
1191  * @since 4.5.0 Support for posts was added.
1192  *
1193  * @global WP_Rewrite $wp_rewrite