Filter hook 'search_feed_link'

in WP Core File wp-includes/link-template.php at line 1287

View Source

search_feed_link

Filter Hook
Description
Retrieves the permalink for the search results comments feed.

Hook Information

File Location wp-includes/link-template.php View on GitHub
Hook Type Filter
Line Number 1287

Hook Parameters

Type Name Description
string $search_query Optional. Search query. Default empty.
string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. Default is the value of get_default_feed().

Usage Examples

Basic Usage
<?php
// Hook into search_feed_link
add_filter('search_feed_link', 'my_custom_filter', 10, 2);

function my_custom_filter($search_query, $feed) {
    // Your custom filtering logic here
    return $search_query;
}

Source Code Context

wp-includes/link-template.php:1287 - How this hook is used in WordPress core
<?php
1282  	} else {
1283  		$link = add_query_arg( 'withcomments', 1, $link );
1284  	}
1285  
1286  	/** This filter is documented in wp-includes/link-template.php */
1287  	return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
1288  }
1289  
1290  /**
1291   * Retrieves the permalink for a post type archive.
1292   *

PHP Documentation

<?php
/**
 * Retrieves the permalink for the search results comments feed.
 *
 * @since 2.5.0
 *
 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
 *
 * @param string $search_query Optional. Search query. Default empty.
 * @param string $feed         Optional. Feed type. Possible values include 'rss2', 'atom'.
 *                             Default is the value of get_default_feed().
 * @return string The comments feed search results permalink.
 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.