get_comment_excerpt
Filters the retrieved comment excerpt.
Usage
add_filter( 'get_comment_excerpt', 'wp_kama_get_comment_excerpt_filter', 10, 3 ); /** * Function for `get_comment_excerpt` filter-hook. * * @param string $excerpt The comment excerpt text. * @param string $comment_ID The comment ID as a numeric string. * @param WP_Comment $comment The comment object. * * @return string */ function wp_kama_get_comment_excerpt_filter( $excerpt, $comment_ID, $comment ){ // filter... return $excerpt; }
- $excerpt(string)
- The comment excerpt text.
- $comment_ID(string)
- The comment ID as a numeric string.
- $comment(WP_Comment)
- The comment object.
Changelog
Since 1.5.0 | Introduced. |
Since 4.1.0 | The $comment_ID and $comment parameters were added. |
Where the hook is called
get_comment_excerpt
wp-includes/comment-template.php 631
return apply_filters( 'get_comment_excerpt', $excerpt, $comment->comment_ID, $comment );