1

I am getting the following php error:

PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, function '' not found or invalid function name in /home/example/public_html/wp-includes/class-wp-hook.php on line 286

The issue is that there is no function name mentioned, how can I identify which function is causing this error?

1
  • 1
    That error suggests that there's a call made to add_action() or add_filter() where the callback is an "empty" one - e.g. it's '' as in add_action( 'init', '' ) or maybe add_action( 'hook_name', $func ) where $func is empty (NULL, '', etc.). Query Monitor can help you identify the hook name and also the plugin/theme file, if it's caused by a code in a plugin or the active theme.
    – Sally CJ
    Nov 20 '19 at 11:25
0

There was a filter in the child theme causing the issue:

add_action('excerpt_length','')

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.