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 :

See the problem ?

The priority must be outside the callback array parameter as follow :

 

  • Hello Nicolas,

    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 …

  • Lucky Malik

    Thanks a lot buddy 🙂

  • Thank you for the info

  • Sajal Das

    thank you for pointing in correct direction.

  • I see the second parenthesis, but where should it be?
    call_user_func_array($the_[‘function’], array_slice($args, 0, (int) $the_[‘accepted_args’]))

    • Menaka S

      Hi,
      You haven’t specified any priority. The priority has to be outside the array which si the second argument.