Warning: call_user_func_array() expects parameter 1 to be a valid callback
This is a recurring error when dealing with actions/filter in WordPress.
The full warning message is actually : Warning: call_user_func_array() expects parameter 1 to be a valid callback array must have exactly two members in…/wp-includes/plugin.php on line 214
In my case, it is usually caused by a filter or an action not properly declared. Typically a parenthesis at the wrong place like :
add_action ( 'action_tag' , array( $this , 'my_callback , 30 ) );
See the problem ?
The priority must be outside the callback array parameter as follow :
add_action ( 'action_tag' , array( $this , 'my_callback ) , 30 );
10 thoughts on “Warning: call_user_func_array() expects parameter 1 to be a valid callback…”
In input field i was getting this error. That reason i will print the textbox input print. Please help.
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘format_for_editor’ not found or invalid function name in /home/multia/public_html/projects/elcom/wp-includes/plugin.php on line 213
Hi, we won’t provide support in the post comments.
Woops! Thanks! that helped me out 🙂
I see the second parenthesis, but where should it be?
call_user_func_array($the_[‘function’], array_slice($args, 0, (int) $the_[‘accepted_args’]))
You haven’t specified any priority. The priority has to be outside the array which si the second argument.
thank you for pointing in correct direction.
Thank you for the info
Thanks a lot buddy 🙂
Great theme – I just donated. I am a PHP developer – new to WordPress but I understand – not so great with CSS.
If you can please help me with this – My client wants to me do 3 things urgently:
– In the Customizer Theme Footer have more than 3 widget areas. How can I add 4th or 5th. Or Add 2 widgets side by side in footer area not below the first
– Put Icons next to a menu (like home icon) – or remove icon when after I clik on Menu item – on th eopened page it displays an icon next to the menu which looks like a report
– How can I modify slider background colors – I think this is CSS but am a bit of novice – using Firefox F12 key …
1) more than 3 footer areas, check this snippet Adding a fourth footer widget area
2) Icons in the menu
3) slider background color, you might want to read this uide on how to customize the CSS of the Customizr theme
Hope this helps!