PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/block-library/navigation-submenu.php +17 -3 23.5.1 → 24.1.0 View file →
@@ -75,12 +75,15 @@
75 75 */
76 76 function gutenberg_render_block_core_navigation_submenu( $attributes, $content, $block ) {
77 77 // Check if this navigation item should render based on post status.
78 78 if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
79 - if ( ! gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block ) ) {
80 - return '';
81 - }
79 + $should_render = gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block );
80 + } else {
81 + $should_render = block_core_shared_navigation_item_should_render( $attributes, $block );
82 82 }
83 + if ( ! $should_render ) {
84 + return '';
85 + }
83 86
84 87 // Don't render the block's subtree if it has no label.
85 88 if ( empty( $attributes['label'] ) ) {
86 89 return '';
@@ -267,8 +270,19 @@
267 270
268 271 $style_attribute = '';
269 272 if ( array_key_exists( 'style', $colors_supports ) ) {
270 273 $style_attribute = $colors_supports['style'];
274 + }
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 + }
271 285 }
272 286
273 287 if ( strpos( $inner_blocks_html, 'current-menu-item' ) ) {
274 288 $tag_processor = new WP_HTML_Tag_Processor( $html );