| @@ -46,19 +46,17 @@ | ||
| 46 | 46 | */ |
| 47 | 47 | function gutenberg_apply_shadow_support( $block_type, $block_attributes ) { |
| 48 | 48 | $has_shadow_support = block_has_support( $block_type, array( 'shadow' ), false ); |
| 49 | 49 | |
| 50 | - if ( | |
| 51 | - ! $has_shadow_support || | |
| 52 | - wp_should_skip_block_supports_serialization( $block_type, 'shadow' ) | |
| 53 | - ) { | |
| 50 | + if ( ! $has_shadow_support ) { | |
| 54 | 51 | return array(); |
| 55 | 52 | } |
| 56 | 53 | |
| 57 | 54 | $shadow_block_styles = array(); |
| 58 | 55 | |
| 59 | - $custom_shadow = $block_attributes['style']['shadow'] ?? null; | |
| 60 | - $shadow_block_styles['shadow'] = $custom_shadow; | |
| 56 | + $preset_shadow = array_key_exists( 'shadow', $block_attributes ) ? "var:preset|shadow|{$block_attributes['shadow']}" : null; | |
| 57 | + $custom_shadow = isset( $block_attributes['style']['shadow'] ) ? $block_attributes['style']['shadow'] : null; | |
| 58 | + $shadow_block_styles['shadow'] = $preset_shadow ? $preset_shadow : $custom_shadow; | |
| 61 | 59 | |
| 62 | 60 | $attributes = array(); |
| 63 | 61 | $styles = gutenberg_style_engine_get_styles( $shadow_block_styles ); |
| 64 | 62 | |