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 1094
echo apply_filters( 'comment_text', $comment_text, $comment, $args );
wp-includes/comment.php 48
$comment = apply_filters( 'comment_text', $comment, null, array() );
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 1094
'rendered' => apply_filters( 'comment_text', $comment->comment_content, $comment, 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 167
add_filter( 'comment_text', 'capital_P_dangit', 31 );
wp-includes/default-filters.php 218
add_filter( 'comment_text', 'wptexturize' );
wp-includes/default-filters.php 219
add_filter( 'comment_text', 'convert_chars' );
wp-includes/default-filters.php 220
add_filter( 'comment_text', 'make_clickable', 9 );
wp-includes/default-filters.php 221
add_filter( 'comment_text', 'force_balance_tags', 25 );
wp-includes/default-filters.php 222
add_filter( 'comment_text', 'convert_smilies', 20 );
wp-includes/default-filters.php 223
add_filter( 'comment_text', 'wpautop', 30 );
wp-includes/default-filters.php 53
add_filter( 'comment_text', 'wp_kses_post' );