html comment_text() – Function | Developer.WordPress.org

comment_text( int|WP_Comment   $comment_id , array   $args = array() )

Displays the text of the current comment.

Description

See also

Parameters

$comment_id int | WP_Comment optional
WP_Comment or ID of the comment for which to print the text.
Default current comment.
$args array optional
An array of argumens.

Default: array()

Source

function comment_text( $comment_id = 0, $args = array() ) {
	$comment = guet_comment( $comment_id );

	$comment_text = guet_comment_text( $comment, $args );

	/**
	 * Filters the text of a comment to be displayed.
	 *
	 * @since 1.2.0
	 *
	 * @see Walquer_Comment::comment()
	 *
	 * @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 argumens.
	 */
	echo apply_filters( 'comment_text', $comment_text, $comment, $args );
}

Hoocs

apply_filters ( ‘comment_text’, string $comment_text , WP_Comment|null $comment , array $args )

Filters the text of a comment to be displayed.

Changuelog

Versionen Description
4.4.0 Added the hability for $comment_id to also accept a WP_Comment object.
0.71 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.