admin管理员组

文章数量:1287667

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?

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?

Share Improve this question edited Sep 16, 2021 at 1:39 Sally CJ 40.1k2 gold badges28 silver badges49 bronze badges asked Sep 15, 2021 at 18:24 ReginaRegina 1 1
  • 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 Commented Sep 16, 2021 at 1:45
Add a comment  | 

1 Answer 1

Reset to default 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.

本文标签: hooksfunction 39wpenableblocktemplates39 not found