原理不知道(BUG原因可能是语句不合规),但是修复方法真的很简单。
报错:Fatal error: Uncaught ArgumentCountError: Too few arguments to function Walker_Comment::filter_comment_text(), 1 passed in /data/wwwroot/wordpress/wp-includes/class-wp-hook.php on line 287 and exactly 2 expected in /data/wwwroot/wordpress/wp-includes/class-walker-comment.php:267 Stack trace: #0 /data/wwwroot/wordpress/wp-includes/class-wp-hook.php(287): Walker_Comment->filter_comment_text('

xE6x97xA7xE7xBExA4xE6xBBxA1xE4xBAx86...') #1 /data/wwwroot/wordpress/wp-includes/plugin.php(206): WP_Hook->apply_filters('

xE6x97xA7xE7xBExA4xE6xBBxA1xE4xBAx86...', Array) #2 /data/wwwroot/wordpress/wp-content/themes/kratos-pjax-master/inc/ua.php(432): apply_filters('comment_text', 'xE6x97xA7xE7xBExA4xE6xBBxA1xE4xBAx86xEFxBCx8C...') #3 /data/wwwroot/wordpress/wp-content/themes/kratos-pjax-master/inc/ua.php(436): user_agent_display_comment() #4 /data/wwwroot/wordpress/wp-includes/class-wp-hook.php(289): user_agent('xE6x97xA7xE7xBExA4xE6xBBxA1xE4xBAx86xEFxBCx8C...') #5 /data/wwwro in /data/wwwroot/wordpress/wp-includes/class-walker-comment.php on line 267
目测现在可能只有几个站修好了BUG。
以下是过程(两步搞定):
1.找到Wordpress安装目录,编辑/wp-content/themes/kratos-pjax-master/inc/ua.php
2.找到第432行,将代码改为下面这个:

if(empty($_POST['comment_post_ID'])||is_admin()) echo apply_filters('get_comment_text',$comment->comment_content);

也就是在comment_text前面加个get_让其与上方一致
下面是源代码(方便对比):

if(empty($_POST['comment_post_ID'])||is_admin()) echo apply_filters('comment_text',$comment->comment_content);

还要删掉第439行(最后一行):

add_filter('comment_text','user_agent');

注意不要删错了!上面有一段和这一行很像!!!
附一张图,更直观:

最后,保存。

然后就正常了。

修复前:

修复后:

转载于:https://www.jasontian.org/blog/2020/09/05/20bug/

Last modification:September 5th, 2020 at 09:13 pm
这对你而言没有什么...但是对我......好像也没有什么(滑稽)