Skip to content

Commit

Permalink
fix remove all patterns in test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed May 3, 2024
1 parent 5e84855 commit 31d070e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions example/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ function() {
}
);

add_action( 'wp_loaded', __NAMESPACE__ . '\remove_core_patterns' );

/**
* Remove core patterns
*/
function remove_core_patterns() {
$patterns = \WP_Block_Patterns_Registry::get_instance()->get_all_registered();
foreach ( $patterns as $pattern ) {
unregister_block_pattern( $pattern['name'] );
}
}


/**
* Remove page level patterns
Expand Down

0 comments on commit 31d070e

Please sign in to comment.