From c0ebb549cc2adf4616933097267bf87e18e9c4b8 Mon Sep 17 00:00:00 2001 From: Vara Date: Thu, 21 Sep 2023 16:51:11 +0530 Subject: [PATCH] Update defensive check in Patterns --- includes/Data/Patterns.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/Data/Patterns.php b/includes/Data/Patterns.php index 8a587788b..c0950b65e 100644 --- a/includes/Data/Patterns.php +++ b/includes/Data/Patterns.php @@ -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'] ) { @@ -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 ] ) ) {