Site logo

Archived topic

Remove support for the block patterns not working

4 replies · Started by trebere on June 24, 2022

Viewing posts 1–5 of 5

Hello,

I'm using the following code to disable the block patterns in a GP (3.1.3) child theme without activating the Premium plugin yet. It does not work in the child theme but if I paste the code in the parent GP 3.1.3 functions.php file it works. What I should check to find out what could be interfering?

/* Disable all default block patterns from block editor library */
function gpc_disable_block_patterns() {
	remove_theme_support( 'core-block-patterns' );
}

add_action( 'after_setup_theme', 'gpc_disable_block_patterns' );

Thank you.

Well, finally I could resolve it.

Thank you.

HI there,

glad to hear you resolved the issue.
What was the problem ? Was it the hook you added the function to ?

Hello,

The problem was that I was conditioning it as is_admin() to run only in the admin area. Removing the condition works fine. What surprises me is that before WordPress version 6 it worked with the condition as I was using it like that until now.

Regards.

Aah ok.
Thanks for explaining :)

This archived topic is closed to new replies.