Seb
Seb

Reputation: 520

Error with functions.php file from a wordpress theme

I don't know anything about php so I cannot figure out if the error is in the code or if it is a matter of update. When I activate a theme on my new Wordpress, I get this error message :

enter image description here.

In the functions.php file, the error-related lines of code are (I believe) the following :

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

Any ideas where the error could come from ?

Upvotes: 0

Views: 876

Answers (1)

Andrew Schultz
Andrew Schultz

Reputation: 4243

I think the issue might be that the function add_plugin_content() requires it to be declared with 4 parameters to be compatible with the framework. You have declared it with only 2 parameters but should declare it like I have written below.

function addPluginContent($filename, $links, $file, $config_url) {
        // insert your code here
}

Upvotes: 2

Related Questions