Uses
Uses | Description |
---|---|
wp-includes/kses.php: wp_kses() | Filters text content and strips out disallowed HTML. |
wp-includes/comment.php: wp_get_current_commenter() | Get current commenter’s name, email, and URL. |
Filters the comment text.
Removes links from the pending comment’s text if the commenter did not consent to the comment cookies.
(string) (Required) Text of the current comment.
(WP_Comment|null) (Required) The comment object. Null if not found.
(string) Filtered text of the current comment.
File: wp-includes/class-walker-comment.php
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; }
Version | Description |
---|---|
5.4.2 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/walker_comment/filter_comment_text