Displays the link to the comments.
Parameters
$comment
int|WP_Commentoptional- Comment object or ID. Defaults to global comment object.
Default:
null
Source
function comment_link( $comment = null ) {
/**
* Filters the current comment's permalink.
*
* @since 3.6.0
*
* @see get_comment_link()
*
* @param string $comment_permalink The current comment permalink.
*/
echo esc_url( apply_filters( 'comment_link', get_comment_link( $comment ) ) );
}
Hooks
- apply_filters( ‘comment_link’,
string $comment_permalink ) Filters the current comment’s permalink.
Create an anchored permalink to a single comment.
The code shown above will result (depending on your permalink settings) in something like this: