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?
add_action()
oradd_filter()
where the callback is an "empty" one - e.g. it's''
as inadd_action( 'init', '' )
or maybeadd_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.