I'm currently working on my website and encountered a problem after updating to the latest WordPress version.

The error message I get is:

call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_enable_block_templates' not found or invalid function name in /www/doc/www.zanggroepvocalis.nl/www/wp-includes/class-wp-hook.php on line 303

I tried to delete line 303, but that didn't work. I also disabled the themes and plugins, but still no success. Any other suggestions?

  • 2
    "I tried to delete line 303" - never edit core files like the class-wp-hook.php! After all, that's not where the actual problem is. And it seems to me that the update was corrupted or incomplete, so try again via the Dashboard admin, or you could also do it manually. (You could try replacing just the wp-includes folder)
    – Sally CJ
    Sep 16, 2021 at 1:45

1 Answer 1


Just to be sure, is "last WordPress version" the 5.8?

wp_enable_block_templates is a function added in the version 5.8 of WordPress. You should find it in wp-includes/theme-templates.php as you can see here.

Check if that function is actually present in your file. If not, probably something gone wrong during the updating. How did you do that? Manually or from the dashboard?

As SallyCJ suggested, just a new correct updating should solve the problem.


Your Answer

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

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