comments_link_feed WordPress Filter Hook

The comments_link_feed hook is used to display a link to the comments feed for a post. This hook is used by the default WordPress theme and can be used in a custom theme.

apply_filters( 'comments_link_feed', string $comment_permalink ) #

Filters the comments permalink for the current post.


Parameters

$comment_permalink

(string)The current comment permalink with '#comments' appended.


Top ↑

More Information

The comments_link_feed allows you to alter the link to the comments section of a post within the context of a feed.

When the ‘comments_link_feed’ filter is called, it is passed once parameters: the list item containing the powered by link.

<pre>add_filter( 'comments_link_feed', 'filter_function_name', 10 );

function filter_function_name( $link) {
    // Manipulate comment link
    return $link;
}

Where ‘filter_function_name’ is the function WordPress should call when the filter is run. Note that the filter function must return a value after it is finished processing or the result will be empty.

filter_function_name should be unique function name. It cannot match any other function name already declared.


Top ↑

Source

File: wp-includes/feed.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.