首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >来自wordpress主题的functions.php文件出错

来自wordpress主题的functions.php文件出错
EN

Stack Overflow用户
提问于 2017-11-13 00:22:35
回答 1查看 283关注 0票数 0

我不知道有关php的任何信息,所以我无法确定错误是否在代码中,或者是否是更新问题。当我在我的新Wordpress上激活一个主题时,我会收到以下错误消息:

在functions.php文件中,与错误相关的代码行(我相信)如下:

代码语言:javascript
复制
    if (!class_exists('mijnpress_plugin_framework')) {
    include('find_replace/mijnpress_plugin_framework.php');

}
class plugin_findreplace extends mijnpress_plugin_framework {
    function __construct() {
        $this->showcredits               = true;
        $this->showcredits_fordevelopers = true;
        $this->plugin_title              = 'Find and replace';
        $this->plugin_class              = 'plugin_findreplace';
        $this->plugin_filename           = 'find-replace/plugins/find_replace.php';
        $this->plugin_config_url         = 'plugins.php?page=' . $this->plugin_filename;
    }
    function plugin_findreplace() {
        $args = func_get_args();
        call_user_func_array(array(
            &$this,
            '__construct'
        ), $args);
    }
    function addPluginSubMenu() {
        $plugin = new plugin_findreplace();

        add_submenu_page('optionsframework', 'documentation', 'Documentation', 'manage_options', 'documentation', 'documentations_callback');
        add_submenu_page('optionsframework', 'Find & Replace', 'Find & Replace', 'manage_options', 'fine_and_replace', 'findreplace_callback');
    }
    /**
     * Additional links on the plugin page
     */
    function addPluginContent($links, $file) {
        $plugin = new plugin_findreplace();
        $links  = parent::addPluginContent($plugin->plugin_filename, $links, $file, $plugin->plugin_config_url);
        return $links;
    }

有什么错误可能来自哪里吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-13 04:08:03

我认为问题可能在于,函数add_plugin_content()要求使用与框架兼容的4个参数来声明它。您只使用两个参数声明了它,但是应该像我在下面所写的那样声明它。

代码语言:javascript
复制
function addPluginContent($filename, $links, $file, $config_url) {
        // insert your code here
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47255522

复制
相关文章

相似问题

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