Skip to content

Commit

Permalink
Update defensive check in Patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-vara committed Sep 21, 2023
1 parent e335c87 commit c0ebb54
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions includes/Data/Patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ public static function get_theme_step_patterns_from_step( $step, $squash = false
}

$pattern_slugs = self::get_theme_step_patterns()[ $active_theme ][ $step ];
$block_patterns = $squash ? '' : array();

foreach ( array_keys( $pattern_slugs ) as $pattern_slug ) {
if ( true !== $pattern_slugs[ $pattern_slug ]['active'] ) {
Expand Down Expand Up @@ -392,11 +393,7 @@ public static function get_theme_step_patterns_from_step( $step, $squash = false
);
continue;
}
if ( isset( $block_patterns ) ) {
$block_patterns .= self::cleanup_wp_grammar( $pattern['content'] );
} else {
$block_patterns = self::cleanup_wp_grammar( $pattern['content'] );
}
$block_patterns .= self::cleanup_wp_grammar( $pattern['content'] );
}

if ( isset( self::get_theme_step_filters()[ $active_theme ][ $step ] ) ) {
Expand Down

0 comments on commit c0ebb54

Please sign in to comment.