comment_text()获取一个评论的内容

目录

描述

Displays the text of a comment. Use get_comment_text() to return a value instead of displaying it.

comment_text() 描述

用法

 <?php comment_text$comment_ID ); ?> 

comment_text() 用法

参数

comment_ID

(integer) (可选) The ID of the comment for which to print the text.

默认值: 0 (the current comment)

comment_text() 参数

源文件

comment_text() 函数的代码位于 wp-includes/comment-template.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Display the text of the current comment.
 *
 * @since 0.71
 *
 * @see Walker_Comment::comment()
 *
 * @param int   $comment_ID ID of the comment for which to print the text. Default 0.
 * @param array $args       Optional. An array of arguments. Default empty array. Default empty.
 */
function comment_text( $comment_ID = 0, $args = array() ) {
	$comment = get_comment( $comment_ID );

	$comment_text = get_comment_text( $comment_ID , $args );
	/**
	 * Filter the text of a comment to be displayed.
	 *
	 * @since 1.2.0
	 *
	 * @see Walker_Comment::comment()
	 *
	 * @param string $comment_text Text of the current comment.
	 * @param object $comment      The comment object.
	 * @param array  $args         An array of arguments.
	 */
	echo apply_filters( 'comment_text', $comment_text, $comment, $args );
}

comment_text() 源文件

相关