[Resolved] Remove support for the block patterns not working

Home Forums Support [Resolved] Remove support for the block patterns not working

Home Forums Support Remove support for the block patterns not working

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2263082
    trebere

    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.

    #2263085
    trebere

    Well, finally I could resolve it.

    Thank you.

    #2263125
    David
    Staff
    Customer Support

    HI there,

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

    #2263139
    trebere

    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.

    #2263148
    David
    Staff
    Customer Support

    Aah ok.
    Thanks for explaining 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.