0

This warning has appeared at the top of our website, and our top menu bar has disappeared:

Warning: call_user_func_array) expects parameter! +~ be a valid callback, function 'smartwp_remove_wp_block_library_css' not found or invalid function name in /home/customer/www/stpetersmedford.org/public_r includes/class-wp-hook.php on line 307

I don’t know how to decipher this message nor how to fix the problem. Are the two things related (disappearance of top menu, this warning)?

Thank you for any help.

1
  • It looks like at some point you followed this: smartwp.com/remove-gutenberg-css But didn't properly delete all the code. Or you renamed the function without renaming the action callback. Apr 8, 2022 at 4:45

1 Answer 1

0

This function, call_user_func_array() is called by add_filter() (or add_action()) that was not declared properly. Scan the code for something like:

add_filter('something', 'smartwp_remove_wp_block_library_css')

to find the culprit. If you do find it and it wasn't something you added/changed, you will have to troubleshoot to determine why this function was not declared/found.

The top menu is still there - you can see it very faintly at the very top of the page as you mouse over the area just above the warning message.

One last thing - it looks like you have display_errors enabled, which is not good practice for a public facing website.

2
  • How do I disable display_errors?
    – user221064
    Apr 14, 2022 at 18:09
  • display_errors could be enabled in wp-config.php, or in .htaccess, or in php.ini (you need to determine which one is loaded in your configuration), or even in httpd.conf. Start with wp-config.php to see if that's where it is enabled - reference https://wordpress.org/support/article/debugging-in-wordpress/.
    – ScottM
    Apr 15, 2022 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.