Last active
January 16, 2025 18:12
-
-
Save audrasjb/a43503cf0c9a8c08de70874b6a9a76df to your computer and use it in GitHub Desktop.
Remove default theme patterns
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 | |
/** | |
* Plugin Name: Remove default theme patterns. | |
* Author: Jb Audras | |
* Version: 0.1 | |
* Author URI: https://whodunit.fr | |
*/ | |
/** | |
* Unregisters default patterns from TT5. | |
*/ | |
function jba_unregister_tt5_patterns() { | |
/** | |
* Add the patterns you want to unregister. | |
* Structure: {theme_slug}/{pattern_file} | |
*/ | |
$block_patterns = array( | |
'twentytwentyfive/banner-about-book', | |
'twentytwentyfive/banner-cover-big-heading' | |
); | |
foreach ( $block_patterns as $block_pattern ) { | |
unregister_block_pattern( $block_pattern ); | |
} | |
} | |
add_filter( 'init', 'jba_unregister_tt5_patterns' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment