comments_link_feed
Filters the comments permalink for the current post.
Description
Parameters (1)
- 0. $get_comments_link (string) =>
get_comments_link()
- The current comment permalink with #comments appended.
Usage
- To run the hook, copy the example below.
- $get_comments_link = apply_filters( 'comments_link_feed', $get_comments_link );
- if ( !empty( $get_comments_link ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the comments_link_feed callback
- function filter_comments_link_feed( $get_comments_link ) {
- // make filter magic happen here...
- return $get_comments_link;
- };
- // add the filter
- add_filter( 'comments_link_feed', 'filter_comments_link_feed', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'comments_link_feed', 'filter_comments_link_feed', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/feed.php
- echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) );