注意:register_uninstall_hook调用不正确

Vik*_*tor 2 debugging wordpress

我自动将我的wordpress安装更新到最新版本.一切看起来正常单位"更新数据库......"它陷入困境.我等了很久,然后关闭了页面,因为什么都没发生.

然后我收到一条关于维护的错误消息,在删除维护文件后我将其删除.

Wordpress显示它运行最新版本,但是当我尝试重新安装时,我得到了相同的错误.我已经尝试禁用所有插件并切换到默认主题,但没有运气.

我将调试设置为true并收到此消息:注意:register_uninstall_hook被错误地调用.卸载钩子中只能使用静态类方法或函数.有关更多信息,请参阅WordPress中的调试.

除了首页上的图像打破布局外,一切看起来都很正常.有小费吗?

Win*_*ess 10

我修复这类问题的方法是在我的项目中进行函数调用的全局搜索.

已经安装了一些插件,这些插件有这样的调用:

register_uninstall_hook(__FILE__, array($this,'uninstall_removedata'));
Run Code Online (Sandbox Code Playgroud)

但它应该是这样的:

register_uninstall_hook( __FILE__, 'uninstall_removedata');
Run Code Online (Sandbox Code Playgroud)

如果您看到错误调用某些内容的消息,则Codex可以非常有用,以确保您使用正确的语法.

在这种情况下,它位于:http: //codex.wordpress.org/Function_Reference/register_uninstall_hook