respond_link
Filters the respond link when a post has no comments.
Description
Parameters (2)
- 0. $respond_link (string)
- The default response link.
- 1. $id (integer)
- The post ID.
Usage
- To run the hook, copy the example below.
- $respond_link = apply_filters( 'respond_link', $respond_link, $id );
- if ( !empty( $respond_link ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the respond_link callback
- function filter_respond_link( $respond_link, $id ) {
- // make filter magic happen here...
- return $respond_link;
- };
- // add the filter
- add_filter( 'respond_link', 'filter_respond_link', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'respond_link', 'filter_respond_link', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/comment-template.php
- echo apply_filters( 'respond_link', $respond_link, $id );