Skip to content

Commit

Permalink
Update class-wp-theme-json-6-2.php
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Dec 15, 2022
1 parent c9814c8 commit 8666b2d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/compat/wordpress-6.2/class-wp-theme-json-6-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,13 @@ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets'
$stylesheet .= _wp_array_get( $this->theme_json, array( 'styles', 'css' ) );

// Add the global styles block CSS.
foreach ( $this->theme_json['styles']['blocks'] as $name => $node ) {
if ( _wp_array_get( $this->theme_json, array( 'styles', 'blocks', $name, 'css' ) ) ) {
$selector = static::$blocks_metadata[ $name ]['selector'];
$custom_block_css = _wp_array_get( $this->theme_json, array( 'styles', 'blocks', $name, 'css' ) );
$stylesheet .= $this->process_nested_css( $custom_block_css, $selector );
if ( isset( $this->theme_json['styles']['blocks'] ) ) {
foreach ( $this->theme_json['styles']['blocks'] as $name => $node ) {
if ( _wp_array_get( $this->theme_json, array( 'styles', 'blocks', $name, 'css' ) ) ) {
$selector = static::$blocks_metadata[ $name ]['selector'];
$custom_block_css = _wp_array_get( $this->theme_json, array( 'styles', 'blocks', $name, 'css' ) );
$stylesheet .= $this->process_nested_css( $custom_block_css, $selector );
}
}
}
}
Expand Down

0 comments on commit 8666b2d

Please sign in to comment.