个性化阅读
专注于IT技术分析

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

我对php一无所知, 所以我无法弄清楚该错误是在代码中还是在更新中。当我在新的Wordpress上激活主题时, 出现以下错误消息:

在此处输入图片说明

.

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

    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;
    }

任何错误可能从何而来的想法?


#1


我认为问题可能出在函数add_plugin_content()要求使用4个参数声明它以与框架兼容。你仅用2个参数声明了它, 但应该像我在下面编写的那样声明它。

function addPluginContent($filename, $links, $file, $config_url) {
        // insert your code here
}
赞(0)
未经允许不得转载:srcmini » 来自wordpress主题的functions.php文件错误

评论 抢沙发

评论前必须登录!