Changeset 52232 for trunk/src/wp-includes/blocks
- Timestamp:
- 11/23/2021 05:38:45 AM (5 years ago)
- Location:
- trunk/src/wp-includes/blocks
- Files:
-
- 6 edited
-
calendar.php (modified) (1 diff)
-
navigation-area.php (modified) (1 diff)
-
navigation-link.php (modified) (1 diff)
-
navigation-submenu.php (modified) (3 diffs)
-
navigation.php (modified) (6 diffs)
-
page-list.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/calendar.php
r52161 r52232 20 20 if ( ! block_core_calendar_has_published_posts() ) { 21 21 if ( is_user_logged_in() ) { 22 return '<div>' . __( 'The calendar block is hidden because there are no published posts.' , 'gutenberg') . '</div>';22 return '<div>' . __( 'The calendar block is hidden because there are no published posts.' ) . '</div>'; 23 23 } 24 24 return ''; -
trunk/src/wp-includes/blocks/navigation-area.php
r52069 r52232 3 3 * Server-side rendering of the `core/navigation-area` block. 4 4 * 5 * @package gutenberg 5 * @deprecated 5.9.0 See https://github.com/WordPress/gutenberg/issues/36524 6 * @package WordPress 6 7 */ 7 8 -
trunk/src/wp-includes/blocks/navigation-link.php
r52069 r52232 3 3 * Server-side rendering of the `core/navigation-link` block. 4 4 * 5 * @package gutenberg5 * @package WordPress 6 6 */ 7 7 -
trunk/src/wp-includes/blocks/navigation-submenu.php
r52069 r52232 3 3 * Server-side rendering of the `core/navigation-submenu` block. 4 4 * 5 * @package gutenberg5 * @package WordPress 6 6 */ 7 7 … … 20 20 ); 21 21 22 $is_sub_menu = isset( $attributes['isTopLevel Link'] ) ? ( ! $attributes['isTopLevelLink'] ) : false;22 $is_sub_menu = isset( $attributes['isTopLevelItem'] ) ? ( ! $attributes['isTopLevelItem'] ) : false; 23 23 24 24 // Text color. … … 151 151 $is_active = ! empty( $attributes['id'] ) && ( get_the_ID() === $attributes['id'] ); 152 152 153 $class_name = ! empty( $attributes['className'] ) ? implode( ' ', (array) $attributes['className'] ) : false;154 155 if ( false !== $class_name ) {156 $css_classes .= ' ' . $class_name;157 }158 159 153 $show_submenu_indicators = isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon']; 160 154 $open_on_click = isset( $block->context['openSubmenusOnClick'] ) && $block->context['openSubmenusOnClick']; -
trunk/src/wp-includes/blocks/navigation.php
r52161 r52232 3 3 * Server-side rendering of the `core/navigation` block. 4 4 * 5 * @package gutenberg5 * @package WordPress 6 6 */ 7 7 … … 15 15 function block_core_navigation_build_css_colors( $attributes ) { 16 16 $colors = array( 17 'css_classes' => array(), 18 'inline_styles' => '', 17 'css_classes' => array(), 18 'inline_styles' => '', 19 'overlay_css_classes' => array(), 20 'overlay_inline_styles' => '', 19 21 ); 20 22 … … 53 55 // Add the custom background-color inline style. 54 56 $colors['inline_styles'] .= sprintf( 'background-color: %s;', $attributes['customBackgroundColor'] ); 57 } 58 59 // Overlay text color. 60 $has_named_overlay_text_color = array_key_exists( 'overlayTextColor', $attributes ); 61 $has_custom_overlay_text_color = array_key_exists( 'customOverlayTextColor', $attributes ); 62 63 // If has overlay text color. 64 if ( $has_custom_overlay_text_color || $has_named_overlay_text_color ) { 65 // Add has-text-color class. 66 $colors['overlay_css_classes'][] = 'has-text-color'; 67 } 68 69 if ( $has_named_overlay_text_color ) { 70 // Add the overlay color class. 71 $colors['overlay_css_classes'][] = sprintf( 'has-%s-color', $attributes['overlayTextColor'] ); 72 } elseif ( $has_custom_overlay_text_color ) { 73 // Add the custom overlay color inline style. 74 $colors['overlay_inline_styles'] .= sprintf( 'color: %s;', $attributes['customOverlayTextColor'] ); 75 } 76 77 // Overlay background color. 78 $has_named_overlay_background_color = array_key_exists( 'overlayBackgroundColor', $attributes ); 79 $has_custom_overlay_background_color = array_key_exists( 'customOverlayBackgroundColor', $attributes ); 80 81 // If has overlay background color. 82 if ( $has_custom_overlay_background_color || $has_named_overlay_background_color ) { 83 // Add has-background class. 84 $colors['overlay_css_classes'][] = 'has-background'; 85 } 86 87 if ( $has_named_overlay_background_color ) { 88 // Add the overlay background-color class. 89 $colors['overlay_css_classes'][] = sprintf( 'has-%s-background-color', $attributes['overlayBackgroundColor'] ); 90 } elseif ( $has_custom_overlay_background_color ) { 91 // Add the custom overlay background-color inline style. 92 $colors['overlay_inline_styles'] .= sprintf( 'background-color: %s;', $attributes['customOverlayBackgroundColor'] ); 55 93 } 56 94 … … 248 286 'wp-block-navigation__responsive-container', 249 287 $is_hidden_by_default ? 'hidden-by-default' : '', 288 implode( ' ', $colors['overlay_css_classes'] ), 250 289 ); 251 290 $open_button_classes = array( … … 256 295 $responsive_container_markup = sprintf( 257 296 '<button aria-expanded="false" aria-haspopup="true" aria-label="%3$s" class="%6$s" data-micromodal-trigger="modal-%1$s"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false"><rect x="4" y="7.5" width="16" height="1.5" /><rect x="4" y="15" width="16" height="1.5" /></svg></button> 258 <div class="%5$s" id="modal-%1$s">297 <div class="%5$s" style="%7$s" id="modal-%1$s"> 259 298 <div class="wp-block-navigation__responsive-close" tabindex="-1" data-micromodal-close> 260 299 <div class="wp-block-navigation__responsive-dialog" role="dialog" aria-modal="true" aria-labelledby="modal-%1$s-title" > … … 271 310 __( 'Close menu' ), // Close button label. 272 311 implode( ' ', $responsive_container_classes ), 273 implode( ' ', $open_button_classes ) 312 implode( ' ', $open_button_classes ), 313 $colors['overlay_inline_styles'] 274 314 ); 275 315 -
trunk/src/wp-includes/blocks/page-list.php
r52042 r52232 35 35 if ( $has_named_text_color ) { 36 36 // Add the color class. 37 $colors['css_classes'][] = sprintf( 'has-%s-color', gutenberg_experimental_to_kebab_case( $context['textColor'] ) );37 $colors['css_classes'][] = sprintf( 'has-%s-color', _wp_to_kebab_case( $context['textColor'] ) ); 38 38 } elseif ( $has_picked_text_color ) { 39 39 $colors['inline_styles'] .= sprintf( 'color: %s;', $context['customTextColor'] ); … … 56 56 if ( $has_named_background_color ) { 57 57 // Add the background-color class. 58 $colors['css_classes'][] = sprintf( 'has-%s-background-color', gutenberg_experimental_to_kebab_case( $context['backgroundColor'] ) );58 $colors['css_classes'][] = sprintf( 'has-%s-background-color', _wp_to_kebab_case( $context['backgroundColor'] ) ); 59 59 } elseif ( $has_picked_background_color ) { 60 60 $colors['inline_styles'] .= sprintf( 'background-color: %s;', $context['customBackgroundColor'] ); … … 75 75 // Give overlay colors priority, fall back to Navigation block colors, then global styles. 76 76 if ( $has_named_overlay_text_color ) { 77 $colors['overlay_css_classes'][] = sprintf( 'has-%s-color', gutenberg_experimental_to_kebab_case( $context['overlayTextColor'] ) );77 $colors['overlay_css_classes'][] = sprintf( 'has-%s-color', _wp_to_kebab_case( $context['overlayTextColor'] ) ); 78 78 } elseif ( $has_picked_overlay_text_color ) { 79 79 $colors['overlay_inline_styles'] .= sprintf( 'color: %s;', $context['customOverlayTextColor'] ); … … 90 90 91 91 if ( $has_named_overlay_background_color ) { 92 $colors['overlay_css_classes'][] = sprintf( 'has-%s-background-color', gutenberg_experimental_to_kebab_case( $context['overlayBackgroundColor'] ) );92 $colors['overlay_css_classes'][] = sprintf( 'has-%s-background-color', _wp_to_kebab_case( $context['overlayBackgroundColor'] ) ); 93 93 } elseif ( $has_picked_overlay_background_color ) { 94 94 $colors['overlay_inline_styles'] .= sprintf( 'background-color: %s;', $context['customOverlayBackgroundColor'] ); … … 183 183 '</button>'; 184 184 } else { 185 $markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class . ' "href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . wp_kses(185 $markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . wp_kses( 186 186 $page['title'], 187 187 wp_kses_allowed_html( 'post' )
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)