comment_text
Filters the text of a comment to be displayed.
Использование
add_filter( 'comment_text', 'wp_kama_comment_text_filter', 10, 3 );
/**
* Function for `comment_text` filter-hook.
*
* @param string $comment_text Text of the comment.
* @param WP_Comment|null $comment The comment object. Null if not found.
* @param array $args An array of arguments.
*
* @return string
*/
function wp_kama_comment_text_filter( $comment_text, $comment, $args ){
// filter...
return $comment_text;
}
- $comment_text(строка)
- Text of the comment.
- $comment(WP_Comment|null)
- The comment object. Null if not found.
- $args(массив)
- An array of arguments.
Список изменений
| С версии 1.2.0 | Введена. |
Где вызывается хук
comment_text
comment_text
comment_text
comment_text
wp-includes/comment-template.php 1090
echo apply_filters( 'comment_text', $comment_text, $comment, $args );
wp-includes/blocks/comment-content.php 37
$comment_text = apply_filters( 'comment_text', $comment_text, $comment, $args );
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 1182
'rendered' => apply_filters( 'comment_text', $comment->comment_content, $comment, array() ),
wp-includes/comment.php 48
$comment = apply_filters( 'comment_text', $comment, null, array() );
Где используется хук в WordPress
wp-includes/class-walker-comment.php 189
add_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40, 2 );
wp-includes/class-walker-comment.php 207
remove_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40 );
wp-includes/default-filters.php 173
add_filter( 'comment_text', 'capital_P_dangit', 31 );
wp-includes/default-filters.php 225
add_filter( 'comment_text', 'wptexturize' );
wp-includes/default-filters.php 226
add_filter( 'comment_text', 'convert_chars' );
wp-includes/default-filters.php 227
add_filter( 'comment_text', 'make_clickable', 9 );
wp-includes/default-filters.php 228
add_filter( 'comment_text', 'force_balance_tags', 25 );
wp-includes/default-filters.php 229
add_filter( 'comment_text', 'convert_smilies', 20 );
wp-includes/default-filters.php 230
add_filter( 'comment_text', 'wpautop', 30 );
wp-includes/default-filters.php 58
add_filter( 'comment_text', 'wp_kses_post' );