Skip to content

Commit 4973b69

Browse files
committed
fix: prevent forearch error
1 parent b782f27 commit 4973b69

File tree

1 file changed

+4
-2
lines changed
  • src/plugins/global-settings/preset-controls

1 file changed

+4
-2
lines changed

src/plugins/global-settings/preset-controls/index.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ public function generate_css_variables_styles( $property, $presets, $prefix, $is
133133

134134
$presets_by_slug = [];
135135
// Convert presets into an associative array with key 'slug'
136-
foreach ( $presets as $preset ) {
137-
$presets_by_slug[ $preset[ 'slug' ] ] = $preset;
136+
if ( is_array( $presets ) ) {
137+
foreach ( $presets as $preset ) {
138+
$presets_by_slug[ $preset[ 'slug' ] ] = $preset;
139+
}
138140
}
139141

140142
// There is no need to generate custom presets in the editor.

0 commit comments

Comments
 (0)