Walker_Comment::filter_comment_text

Advertisement

Summery Summery

Filters the comment text.

Syntax Syntax

Walker_Comment::filter_comment_text( string $comment_text, WP_Comment|null $comment )

Description Description

Removes links from the pending comment’s text if the commenter did not consent to the comment cookies.

Parameters Parameters

$comment_text

(string) (Required) Text of the current comment.

$comment

(WP_Comment|null) (Required) The comment object. Null if not found.

Return Return

(string) Filtered text of the current comment.

Source Source

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;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
5.4.2 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.