Skip to content

Instantly share code, notes, and snippets.

@audrasjb
Last active January 16, 2025 18:12
Show Gist options
  • Select an option

  • Save audrasjb/a43503cf0c9a8c08de70874b6a9a76df to your computer and use it in GitHub Desktop.

Select an option

Save audrasjb/a43503cf0c9a8c08de70874b6a9a76df to your computer and use it in GitHub Desktop.

Revisions

  1. audrasjb renamed this gist Jan 16, 2025. 1 changed file with 0 additions and 0 deletions.
  2. audrasjb created this gist Jan 16, 2025.
    25 changes: 25 additions & 0 deletions jba-remove-tt5-patterns.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    <?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' );