post_comments_link filter-hookWP 2.7.0

Filters the formatted post comments link HTML.

Usage

add_filter( 'post_comments_link', 'wp_kama_post_comments_link_filter', 10, 2 );

/**
 * Function for `post_comments_link` filter-hook.
 * 
 * @param string      $formatted The HTML-formatted post comments link.
 * @param int|WP_Post $post      The post ID or WP_Post object.
 *
 * @return string
 */
function wp_kama_post_comments_link_filter( $formatted, $post ){

	// filter...
	return $formatted;
}
$formatted(string)
The HTML-formatted post comments link.
$post(int|WP_Post)
The post ID or WP_Post object.

Changelog

Since 2.7.0 Introduced.

Where the hook is called

get_post_reply_link()
post_comments_link
wp-includes/comment-template.php 1871
return apply_filters( 'post_comments_link', $formatted_link, $post );

Where the hook is used in WordPress

Usage not found.