Error: call_user_func_array() expects parameter 1 to be a valid callback

I have issue after upgrading my wordpress to 3.6 see below for errors which displays on wordpress admin panel not on front of website.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘regis_options’ not found or invalid function name in wp-includes/plugin.php on line 406

Warning: Cannot modify header information – headers already sent by (output started at wp-includes/plugin.php:406) in wp-includes/option.php on line 571

Warning: Cannot modify header information – headers already sent by (output started at wp-includes/plugin.php:406) in wp-includes/option.php on line 572

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Somewhere in your theme or plugins is a line like this:

add_filter( 'something', 'regis_options' );

Could also be add_action(). Find that piece of code and remove or fix it.

The other errors are a result of the first one. The printed error message causes output and hence HTTP headers, so PHP/WP cannot send other headers anymore. They will go away when you fix the first error.

Method 2

Warning: call_user_func_array()

It is usually caused by a filter or an action not properly declared.

add_filter ( 'action_tag' , array( $this , 'my_callback' ) , 30 );

The priority must be outside the callback array parameter. this fixed my issue.

Method 3

Hi try this solution :

Add this in functions.php:

function regis_options($args) {
   return $args;
}

Also add this in your class-wp-hook.php:

public function regis_options($args) {
echo '<pre>' . var_export($args, true) . '</pre>';
echo '<pre>' . var_dump(debug_backtrace()) . '</pre>';
return $args;
}

Method 4

I had put a space at the end on my call back string on calling the filter

add_filter( 'something', 'regis_options ' );

Instead of

add_filter( 'something', 'regis_options');

Method 5

This error will also happen when you call for a function that does not exist.
to solve it
you need to define the ‘regis_options’ function
try something like

function regis_options(){ 
echo 'test';
}


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x