comment_excerpt filter-hookWP 1.2.0

Filters the comment excerpt for display.

Usage

add_filter( 'comment_excerpt', 'wp_kama_comment_excerpt_filter', 10, 2 );

/**
 * Function for `comment_excerpt` filter-hook.
 * 
 * @param string $comment_excerpt The comment excerpt text.
 * @param string $comment_id      The comment ID as a numeric string.
 *
 * @return string
 */
function wp_kama_comment_excerpt_filter( $comment_excerpt, $comment_id ){

	// filter...
	return $comment_excerpt;
}
$comment_excerpt(string)
The comment excerpt text.
$comment_id(string)
The comment ID as a numeric string.

Changelog

Since 1.2.0 Introduced.
Since 4.1.0 The $comment_id parameter was added.

Where the hook is called

comment_excerpt()
comment_excerpt
wp-includes/comment-template.php 705
echo apply_filters( 'comment_excerpt', $comment_excerpt, $comment->comment_ID );

Where the hook is used in WordPress

wp-includes/default-filters.php 222
add_filter( 'comment_excerpt', 'convert_chars' );