The goal of this post is to index warnings and how to troubleshoot them, some example solutions so we don’t have to scour threads for answers. Let’s see how we do!
What call_user_func_array(), array_unique(), array_search() type warnings may mean
Here are some typical warnings you might see when editing or adding a post in WordPress:
If you see these following warnings show up it’s typically after an update to WordPress core, your theme, or plugins.
Warning: call_user_func_array() expects parameter 1 to be a valid
callback, function 'some_functions_name' not found or invalid
function name in /.../wp-includes/class-wp-hook.php on line 286
call_user_func_array() warning above lists the name of the function
add_action('location_of_action','name_of_function');
// or
add_filter('location_of_filter','name_of_function');
Basically, that reference needs to be removed, for me it was commenting out a reference to: “add_filter( ‘tiny_mce_plugins’, ‘disable_emojis_tinymce’ );” which I was part of a mega function I created to strip a lot of junk out of
The easiest way you find the function in question is to try to find the referenced function in your wp-content folder. When I’m trying to quickly find code, I download my theme and plugins via ftp and search those folders for the name of the function.
If it happens to be in a plugin, often updating that plugin can help if it hasn’t been updated, meaning WordPress core updated, or PHP version updated, or some such and corresponding plugin wasn’t yet updated to match. If that doesn’t work, reach out to the plugin developer and let them know and wait. Not much else you can do, (its just a warning anyway and can be hidden by turning off debug mode).
How to turn off wp_debug mode
For most hosts its by changing a line in your wp-config.php file from:
define('WP_DEBUG', true);
// change above to the following:
define('WP_DEBUG', false);
Warning: array_unique() expects parameter 1 to be array, null given in /.../wp-includes/class-wp-editor.php on line 426
Warning: array_search() expects parameter 2 to be array, null given in /.../wp-includes/class-wp-editor.php on line 428
Warning: implode(): Invalid arguments passed in /.../wp-includes/class-wp-editor.phpon line 515
These warnings should get fixed with the top warning being addressed. They’re just additional references expecting the function that you referenced that no longer exists in
Leave a Reply