Filter hook 'get_comment_text'

in WP Core File wp-includes/comment-template.php at line 1063

View Source

get_comment_text

Filter Hook
Description
Filters the text of a comment.

Hook Information

File Location wp-includes/comment-template.php View on GitHub
Hook Type Filter
Line Number 1063

Hook Parameters

Type Name Description
string $comment_text Text of the comment.
WP_Comment $comment The comment object.
array $args An array of arguments.

Usage Examples

Basic Usage
<?php
// Hook into get_comment_text
add_filter('get_comment_text', 'my_custom_filter', 10, 3);

function my_custom_filter($comment_text, $comment, $args) {
    // Your custom filtering logic here
    return $comment_text;
}

Source Code Context

wp-includes/comment-template.php:1063 - How this hook is used in WordPress core
<?php
1058  	 *
1059  	 * @param string     $comment_text Text of the comment.
1060  	 * @param WP_Comment $comment      The comment object.
1061  	 * @param array      $args         An array of arguments.
1062  	 */
1063  	return apply_filters( 'get_comment_text', $comment_text, $comment, $args );
1064  }
1065  
1066  /**
1067   * Displays the text of the current comment.
1068   *

PHP Documentation

<?php
/**
	 * Filters the text of a comment.
	 *
	 * @since 1.5.0
	 *
	 * @see Walker_Comment::comment()
	 *
	 * @param string     $comment_text Text of the comment.
	 * @param WP_Comment $comment      The comment object.
	 * @param array      $args         An array of arguments.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/comment-template.php
Related Hooks

Related hooks will be displayed here in future updates.