Walker_Comment::filter_comment_text()
Filters the comment text.
Removes links from the pending comment's text if the commenter did not consent to the comment cookies.
Метод класса: Walker_Comment{}
Хуков нет.
Возвращает
Строку
. Filtered text of the current comment.
Использование
$Walker_Comment = new Walker_Comment(); $Walker_Comment->filter_comment_text( $comment_text, $comment );
- $comment_text(строка) (обязательный)
- Text of the current comment.
- $comment(WP_Comment|null) (обязательный)
- The comment object. Null if not found.
Список изменений
С версии 5.4.2 | Введена. |
Код Walker_Comment::filter_comment_text() Walker Comment::filter comment text WP 6.4.3
public function filter_comment_text( $comment_text, $comment ) { $commenter = wp_get_current_commenter(); $show_pending_links = ! empty( $commenter['comment_author'] ); if ( $comment && '0' == $comment->comment_approved && ! $show_pending_links ) { $comment_text = wp_kses( $comment_text, array() ); } return $comment_text; }