RSS

WordPress 升级新版本后评论内容不显示

升级了 wordpress 新版本,评论内容丢失,该如何解决。。。

找到 \wp-includes\comment-template.php 文件,搜索函数名:comment_text。

源代码如下:

  1. function comment_text( $comment_ID = 0, $args = array() ) {  
  2.     $comment = get_comment( $comment_ID );  
  3.   
  4.     $comment_text = get_comment_text( $comment$args );  
  5.     /** 
  6.      * Filters the text of a comment to be displayed. 
  7.      * 
  8.      * @since 1.2.0 
  9.      * 
  10.      * @see Walker_Comment::comment() 
  11.      * 
  12.      * @param string          $comment_text Text of the current comment. 
  13.      * @param WP_Comment|null $comment      The comment object. 
  14.      * @param array           $args         An array of arguments. 
  15.      */  
  16.     echo apply_filters( ‘comment_text’, $comment_text$comment$args );  
  17. }  

修改为:

  1. function comment_text( $comment_ID = 0 ) {  
  2.     $comment = get_comment( $comment_ID );  
  3.     echo(get_comment_text( $comment_ID ));  
  4. }  

此条目发表在 WordPress 分类目录,贴了 , , , , 标签。将 固定链接 加入收藏夹。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注