Hot answers tagged

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? ...


1

save_post becomes unwieldy under Gutenberg, in my experience. It fires at least twice, and none of the checks you have in place will distinguish between instances. I would consider replacing it with wp_after_insert_post, which was introduced into core for this very reason.


1

When you add a filter to post_type_link, you are telling WordPress to run the hooked function on the result of the get_post_permalink() function. So any time that function runs, so does yours. When I tested the filter myself, I only saw a printed message once for each link, but if you have something like this: if ( get_permalink() ) { the_permalink(); } ...


1

Remove the function inside the function, and instead call the wp_register_script and register_block_type inside the large function. Finally, remove the inner add_action() call, so you only have the ending one for the large function. function irm_lockdown_author_role() { if (isset($userrole->roles[0])) { $current_role = $userrole->roles[0]; } else {...


Only top voted, non community-wiki answers of a minimum length are eligible