
WordPress短代码的终极指南
comment_text ( $comment_ID = 0, $args = array() )
comment_text用于显示评论的文本。它不需要参数,只是输出评论的内容。你通常会在WordPress的循环中使用这个函数来显示某个特定文章的评论。
显示当前评论的文本。
function comment_text( $comment_ID = 0, $args = array() ) { $comment = get_comment( $comment_ID ); $comment_text = get_comment_text( $comment, $args ); /** * Filters 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 WP_Comment|null $comment The comment object. Null if not found. * @param array $args An array of arguments. */ echo apply_filters( 'comment_text', $comment_text, $comment, $args ); }