首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >升级到WordPress 3.6时WPAchemy出现错误

升级到WordPress 3.6时WPAchemy出现错误
EN

Stack Overflow用户
提问于 2013-08-19 22:13:51
回答 2查看 365关注 0票数 2

我一直使用WPAlchemy类在WordPress中创建元盒子,这在我升级到WordPress 3.6之前一直很好。

随着升级,我突然开始得到以下错误:

代码语言:javascript
运行
复制
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method WPAlchemy_MetaBox::_global_head() should not be called statically in /wp-includes/plugin.php on line 406

Strict Standards: Non-static method WPAlchemy_MetaBox::_is_post() should not be called statically in /wp-content/wpalchemy/MetaBox.php on line 1352

Strict Standards: Non-static method WPAlchemy_MetaBox::_is_post_or_page() should not be called statically in /wp-content/wpalchemy/MetaBox.php on line 986

Strict Standards: Non-static method WPAlchemy_MetaBox::_get_current_post_type() should not be called statically in /wp-content/wpalchemy/MetaBox.php on line 1024

Strict Standards: Non-static method WPAlchemy_MetaBox::_is_page() should not be called statically in /wp-content/wpalchemy/MetaBox.php on line 1352

Strict Standards: Non-static method WPAlchemy_MetaBox::_is_post_or_page() should not be called statically in /wp-content/wpalchemy/MetaBox.php on line 1005

Strict Standards: Non-static method WPAlchemy_MetaBox::_get_current_post_type() should not be called statically in /wp-content/wpalchemy/MetaBox.php on line 1024

无论我是否实际创建了任何元框,都会出现这些错误。

其他一些人似乎也有同样的问题,但我没有找到解决方案(除了禁用错误报告,这并不是真正的解决方案)。不幸的是,这超出了我相当基本的PHP技能。

EN

回答 2

Stack Overflow用户

发布于 2013-10-17 21:03:37

似乎我已经在这个问题上创建了一个解决方案。这里有一些帮助:http://www.pirenko.com/blog/2013/10/17/wpalchemy-warnings-fix/

票数 1
EN

Stack Overflow用户

发布于 2013-12-14 12:57:05

虽然Pirenko链接的补丁正在工作,但这绝对不是解决问题的最佳方法,因为补丁作者只是添加了重复的代码,并避免使用标准的WPAlchemy方法。

此外,那个补丁不知何故导致了我正在处理的插件的问题,所以我不辞辛劳地亲自修复了与WPAlchemy相关的严格通知。以下是更改:https://github.com/mch0lic/wpalchemy/commit/d53216953b1e0f761c6b2f94da257a638f85aa8a

注意,我不确定是否可以将add_action钩子移动到构造器,因为我并不真正熟悉WPAlchemy及其工作流程,但即使在更改WPAlchemy相关代码之后,我的插件也可以正常工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18316023

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档