Hi, In this article I am going to explain how you can solve below error :
Warning: call_user_func(..) [function.call-user-func]: First argument is expected to be a valid callback Solution
While working with wordpress we always get lots of common errors for which we get solutions easily, This error came because of silly mistake by developer but mostly not able to figure it out. Same happened with me, So I thought to share it with WordPress Addicted readers, So it would be helpful to WordPress Freelancer, WordPress Developers someday.
So for example you get warning like this :
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'twenty_ten_callback' was given in D:\xampp\htdocs\projects\test\wp-includes\plugin.php on line 170
Now this error means It will try to call function name ‘twenty_ten_callback’ but that function is not defined or written or not come in scope of script. So might be you forgot to include file in which this function exists. Sometimes we write function but forgot to include file to make available that function and call that function and at that time this error come.
So simply include file of function in script you running or make that function available in scope of script, This error will disappear.
I am wordpress Developer, WordPress Developer India and WordPress Freelancer India. If you have any projects related to wordpress or PHP you can contact me.
No Comments