get_comments_link filter-hookWP 3.6.0

Filters the returned post comments permalink.

Usage

add_filter( 'get_comments_link', 'wp_kama_get_comments_link_filter', 10, 2 );

/**
 * Function for `get_comments_link` filter-hook.
 * 
 * @param string      $comments_link Post comments permalink with '#comments' appended.
 * @param int|WP_Post $post_id       Post ID or WP_Post object.
 *
 * @return string
 */
function wp_kama_get_comments_link_filter( $comments_link, $post_id ){

	// filter...
	return $comments_link;
}
$comments_link(string)
Post comments permalink with '#comments' appended.
$post_id(int|WP_Post)
Post ID or WP_Post object.

Changelog

Since 3.6.0 Introduced.

Where the hook is called

get_comments_link()
get_comments_link
wp-includes/comment-template.php 826
return apply_filters( 'get_comments_link', $comments_link, $post_id );

Where the hook is used in WordPress

Usage not found.