← All changes
|
build/scripts/block-library/navigation-submenu.php
+11
-0
23.7.2
→
trunk
View file →
| @@ -272,8 +272,19 @@ | ||
| 272 | 272 | if ( array_key_exists( 'style', $colors_supports ) ) { |
| 273 | 273 | $style_attribute = $colors_supports['style']; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | + /* | |
| 277 | + * Shadow serialization is skipped for this block so the shadow lands on the | |
| 278 | + * dropdown panel, the floating layer it is meant for, and not the menu item. | |
| 279 | + */ | |
| 280 | + if ( ! empty( $attributes['style']['shadow'] ) ) { | |
| 281 | + $shadow_styles = gutenberg_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ) ); | |
| 282 | + if ( ! empty( $shadow_styles['css'] ) ) { | |
| 283 | + $style_attribute .= $shadow_styles['css']; | |
| 284 | + } | |
| 285 | + } | |
| 286 | + | |
| 276 | 287 | if ( strpos( $inner_blocks_html, 'current-menu-item' ) ) { |
| 277 | 288 | $tag_processor = new WP_HTML_Tag_Processor( $html ); |
| 278 | 289 | while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-navigation-item' ) ) ) { |
| 279 | 290 | $tag_processor->add_class( 'current-menu-ancestor' ); |