Skip to content

Commit

Permalink
Plugin: Unregister only registered block patterns (#31325)
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo authored and youknowriad committed Apr 29, 2021
1 parent b525653 commit 082908c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ function() {
}

foreach ( $core_block_patterns as $core_block_pattern ) {
unregister_block_pattern( 'core/' . $core_block_pattern );
$name = 'core/' . $core_block_pattern;
if ( WP_Block_Patterns_Registry::get_instance()->is_registered( $name ) ) {
unregister_block_pattern( $name );
}
}

foreach ( $new_core_block_patterns as $core_block_pattern ) {
Expand Down

0 comments on commit 082908c

Please sign in to comment.