Filter hook 'feed_links_extra_show_post_comments_feed'

in WP Core File wp-includes/general-template.php at line 3350

View Source

feed_links_extra_show_post_comments_feed

Filter Hook
Description
Filters whether to display the post comments feed link. This filter allows to enable or disable the feed link for a singular post in a way that is independent of {@see 'feed_links_show_comments_feed'} (which controls the global comments feed). The result of that filter is accepted as a parameter.

Hook Information

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

Hook Parameters

Type Name Description
bool $show_comments_feed Whether to display the post comments feed link. Defaults to the {@see 'feed_links_show_comments_feed'} filter result.

Usage Examples

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

function my_custom_filter($show_comments_feed) {
    // Your custom filtering logic here
    return $show_comments_feed;
}

Source Code Context

wp-includes/general-template.php:3350 - How this hook is used in WordPress core
<?php
3345  		 * @since 6.1.0
3346  		 *
3347  		 * @param bool $show_comments_feed Whether to display the post comments feed link. Defaults to
3348  		 *                                 the {@see 'feed_links_show_comments_feed'} filter result.
3349  		 */
3350  		$show_post_comments_feed = apply_filters( 'feed_links_extra_show_post_comments_feed', $show_comments_feed );
3351  
3352  		if ( $show_post_comments_feed && ( comments_open() || pings_open() || $post->comment_count > 0 ) ) {
3353  			$title = sprintf(
3354  				$args['singletitle'],
3355  				get_bloginfo( 'name' ),

PHP Documentation

<?php
/**
		 * Filters whether to display the post comments feed link.
		 *
		 * This filter allows to enable or disable the feed link for a singular post
		 * in a way that is independent of {@see 'feed_links_show_comments_feed'}
		 * (which controls the global comments feed). The result of that filter
		 * is accepted as a parameter.
		 *
		 * @since 6.1.0
		 *
		 * @param bool $show_comments_feed Whether to display the post comments feed link. Defaults to
		 *                                 the {@see 'feed_links_show_comments_feed'} filter result.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.