Changeset 55475 for trunk/src/wp-includes/blocks/navigation-submenu.php
- Timestamp:
- 03/07/2023 03:29:47 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/navigation-submenu.php
r55257 r55475 10 10 * which will be applied to the navigation markup in the front-end. 11 11 * 12 * @param array $context Navigation block context. 13 * @param array $attributes Block attributes. 12 * @param array $context Navigation block context. 13 * @param array $attributes Block attributes. 14 * @param bool $is_sub_menu Whether the block is a sub-menu. 14 15 * @return array Colors CSS classes and inline styles. 15 16 */ 16 function block_core_navigation_submenu_build_css_colors( $context, $attributes ) {17 function block_core_navigation_submenu_build_css_colors( $context, $attributes, $is_sub_menu = false ) { 17 18 $colors = array( 18 19 'css_classes' => array(), 19 20 'inline_styles' => '', 20 21 ); 21 22 $is_sub_menu = isset( $attributes['isTopLevelItem'] ) ? ( ! $attributes['isTopLevelItem'] ) : false;23 22 24 23 // Text color. … … 251 250 252 251 if ( $has_submenu ) { 252 $colors = block_core_navigation_submenu_build_css_colors( $block->context, $attributes, $has_submenu ); 253 $classes = array_merge( 254 array( 'wp-block-navigation__submenu-container' ), 255 $colors['css_classes'] 256 ); 257 $css_classes = trim( implode( ' ', $classes ) ); 258 259 $style_attribute = $colors['inline_styles']; 260 253 261 $inner_blocks_html = ''; 254 262 foreach ( $block->inner_blocks as $inner_block ) { … … 264 272 } 265 273 274 $wrapper_attributes = get_block_wrapper_attributes( 275 array( 276 'class' => $css_classes, 277 'style' => $style_attribute, 278 ) 279 ); 280 266 281 $html .= sprintf( 267 '<ul class="wp-block-navigation__submenu-container">%s</ul>', 282 '<ul %s>%s</ul>', 283 $wrapper_attributes, 268 284 $inner_blocks_html 269 285 ); 286 270 287 } 271 288
Note: See TracChangeset
for help on using the changeset viewer.