Filters the comments permalink for the current post.
$comment_permalinkstring
'#comments' appended.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.
echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) );
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/comments_link_feed