Last active
August 1, 2025 09:21
-
-
Save nicmare/d7242271f0928207e008e561735fa751 to your computer and use it in GitHub Desktop.
This snippet removes the default patterns and "blocksy" pattern category created by blocksy theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action("init", "init_blocks_and_patterns",100); | |
| function init_blocks_and_patterns(){ | |
| if(\WP_Block_Pattern_Categories_Registry::get_instance()->is_registered("blocksy")){ | |
| unregister_block_pattern_category( 'blocksy'); | |
| $blocksy_patterns = [ | |
| "posts-layout-1", | |
| "posts-layout-2", | |
| "posts-layout-3", | |
| "posts-layout-4", | |
| "posts-layout-5", | |
| "tax-layout-1", | |
| "tax-layout-2", | |
| "tax-layout-3", | |
| "tax-layout-4" | |
| ]; | |
| foreach($blocksy_patterns as $pattern){ | |
| if(\WP_Block_Patterns_Registry::get_instance()->is_registered("blocksy/".$pattern)) | |
| unregister_block_pattern( "blocksy/".$pattern); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment