0

Following the update to WP 3.9.1 and MySQL I am getting the following error on a site:

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method dc_jqverticalmegamenu::header() should not be called statically in /home/xyzsite/public_html/wp-includes/plugin.php on line 470

The reference is to this plugin. A quick search shows about 82 pages out there with the same error, but no reference to a solution. I would appreciate some guidance on resolving this.

1

You should contact the plugin author, because plugin support is generally off topic on this site.

But ... I got curious, peeked into the plugin code and found this line:

add_action( 'wp_head', array('dc_jqverticalmegamenu', 'header') );

where the header() method is assumed static, but it's not:

function header(){
    // ...
}

That's why this strict notice pops up.

The plugin creates an instance of the class through:

  // Initialize the plugin.
 $dcjqverticalmegamenu = new dc_jqverticalmegamenu();

so you should instead try:

add_action( 'wp_head', array( $this, 'header') );

and similar for the other static calls.

  • 1
    My kind friend, birgire, thank you for taking the time to address an off-topic issue - which really has been a show-stopper for the site. Your solution was spot on. In addition I have contacted the plugin author. Thank you again for your assistance. – fmz May 27 '14 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.