注意:register_uninstall_hook被错误地调用 [英] Notice: register_uninstall_hook was called incorrectly

查看:284
本文介绍了注意:register_uninstall_hook被错误地调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我自动将我的wordpress安装更新到最新版本。一切都看起来正常的单位更新数据库...,它被卡住了。我等了很久,然后关闭页面,因为没有发生任何事情。



然后,我收到一条关于维护的错误消息,在删除维护文件后我已经删除了。



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



我将调试设置为true,并收到以下消息:
Notice :register_uninstall_hook被调用不正确。卸载挂钩中只能使用静态类方法或函数。请参阅WordPress中的调试了解更多信息。



除了首页上的图像正在打破布局,一切看起来都很正常。
任何提示?

解决方案

我修复这种类型的问题的方式是在我的项目中进行全球搜索对于函数调用。



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

  register_uninstall_hook(__ FILE__,array($ this,'uninstall_removedata')); 

但应该是这样的:

  register_uninstall_hook(__FILE__,'uninstall_removedata'); 

如果您看到一条消息称为不正确的名称,食典可以非常有帮助,以确保您使用正确的语法。



在这种情况下,这里是:
http://codex.wordpress.org/Function_Reference/register_uninstall_hook


I automatically updated my wordpress installation to the latest version. Everything looked normal unit "updating database..." where it got stuck. I waited for a long while and then closed the page, since nothing was happening.

Then I got a error message saying something about maintenance, which I got rid of after deleting the maintenance file.

Wordpress displays that it runs the latest version, but when I try to reinstall I get the same errror. I've tried disabling all plugins and switch to the default theme, but no luck.

I set the debug to true and I got this message: Notice: register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information.

Everything looks normal except a image on the front page is breaking the layout. Any tips?

解决方案

The way I fixed this type of problem, was to do a global search in my project for the function call.

Some plugins had been installed which had calls such as this:

register_uninstall_hook(__FILE__, array($this,'uninstall_removedata'));

but it should be this:

register_uninstall_hook( __FILE__, 'uninstall_removedata');

If you see a message that something is called incorrectly, the Codex can be very helpful to make sure you use the correct syntax.

In this case it is here: http://codex.wordpress.org/Function_Reference/register_uninstall_hook

这篇关于注意:register_uninstall_hook被错误地调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆