1.打开wordpress目录,将\wp-includes\comment-template.php文件打开编辑;
2.ctrl+f搜索 function comment_text 函数;
3.将此函数代码全部注释;
-
每一行前面加
/*
/*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. * @param array $args An array of arguments. */ /*echo apply_filters( 'comment_text', $comment_text, $comment, $args ); /*}
4.复制粘贴以下代码;
function comment_text( $comment_ID = 0 ) {
$comment = get_comment( $comment_ID );
echo(get_comment_text( $comment_ID ));
}