mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Editor: Update @wordpress packages for 6.2 Beta 5.
Updates the `@wordpress` packages to include the following changes: - Add border radius to off canvas navigation menu items - Remove border from quick inserter child elements - Show variant patterns even if there are no patterns for the Query Loop block - Order initial block items in Navigation with PrivateInserter - Update: Add descriptions to all panels in the Site Editor's dark side - Fix typo in template parts description - Fix: Browse mode descriptions margin - Fix: Show creation popover on empty page links in the navigation sidebar - Make sure the directly inserted block in the Nav block is a Page link - Fix browser history when synchronising state with urls - Navigation Sidebar: Change the logic about which navigation gets selected for the sidebar - Fixes extra UI in navigation block inspector - Renames parent selection boolean param and improves docs - Widget Importer: Fix Widget Group block imports - Don't add Post Content layout styles to title in the post editor - Site editor: Add hover animation to site editor canvas - Prevent the saving button from showing when renaming templates - Navigation Block: Fix big spinner - Navigation: Don't save the level of the link in an attribute - Focus 1st parent block on block remove, if no previous block is available - Navigation: Performance: improve params in `block_core_navigation_get_most_recently_published_navigation()` - Navigation Block inspector: fix link UI popover opening on links that have a url - Fix for `WP_Theme_JSON_Resolver::get_merged_data()` - Site Editor: Add page details when viewing a specific page. - Fix site editor sidebar scrollbars - Fix: Custom link UI does appears outside canvas on the sidebar navigation - Fix: Make navigation page list load its items on navigation sidebar References: * [d14fea64bdGutenberg's commit for publishing the packages] * [dbe47a5e8fGutenberg's commit for `blocks/navigation-link.php` and `blocks/navigation-submenu.php`] * [ea74a306e5Gutenberg's commit for `blocks/navigation.php`] Follow-up to [55441], [55440]. Props ntsekouras, mamaduka, gziolo, costdev, hellofromTonya. See #57471. git-svn-id: https://develop.svn.wordpress.org/trunk@55475 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -9,18 +9,17 @@
|
||||
* Build an array with CSS classes and inline styles defining the colors
|
||||
* which will be applied to the navigation markup in the front-end.
|
||||
*
|
||||
* @param array $context Navigation block context.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param array $context Navigation block context.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param bool $is_sub_menu Whether the link is part of a sub-menu.
|
||||
* @return array Colors CSS classes and inline styles.
|
||||
*/
|
||||
function block_core_navigation_link_build_css_colors( $context, $attributes ) {
|
||||
function block_core_navigation_link_build_css_colors( $context, $attributes, $is_sub_menu = false ) {
|
||||
$colors = array(
|
||||
'css_classes' => array(),
|
||||
'inline_styles' => '',
|
||||
);
|
||||
|
||||
$is_sub_menu = isset( $attributes['isTopLevelLink'] ) ? ( ! $attributes['isTopLevelLink'] ) : false;
|
||||
|
||||
// Text color.
|
||||
$named_text_color = null;
|
||||
$custom_text_color = null;
|
||||
|
||||
@@ -9,18 +9,17 @@
|
||||
* Build an array with CSS classes and inline styles defining the colors
|
||||
* which will be applied to the navigation markup in the front-end.
|
||||
*
|
||||
* @param array $context Navigation block context.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param array $context Navigation block context.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param bool $is_sub_menu Whether the block is a sub-menu.
|
||||
* @return array Colors CSS classes and inline styles.
|
||||
*/
|
||||
function block_core_navigation_submenu_build_css_colors( $context, $attributes ) {
|
||||
function block_core_navigation_submenu_build_css_colors( $context, $attributes, $is_sub_menu = false ) {
|
||||
$colors = array(
|
||||
'css_classes' => array(),
|
||||
'inline_styles' => '',
|
||||
);
|
||||
|
||||
$is_sub_menu = isset( $attributes['isTopLevelItem'] ) ? ( ! $attributes['isTopLevelItem'] ) : false;
|
||||
|
||||
// Text color.
|
||||
$named_text_color = null;
|
||||
$custom_text_color = null;
|
||||
@@ -250,6 +249,15 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
||||
}
|
||||
|
||||
if ( $has_submenu ) {
|
||||
$colors = block_core_navigation_submenu_build_css_colors( $block->context, $attributes, $has_submenu );
|
||||
$classes = array_merge(
|
||||
array( 'wp-block-navigation__submenu-container' ),
|
||||
$colors['css_classes']
|
||||
);
|
||||
$css_classes = trim( implode( ' ', $classes ) );
|
||||
|
||||
$style_attribute = $colors['inline_styles'];
|
||||
|
||||
$inner_blocks_html = '';
|
||||
foreach ( $block->inner_blocks as $inner_block ) {
|
||||
$inner_blocks_html .= $inner_block->render();
|
||||
@@ -263,10 +271,19 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
||||
$html = $tag_processor->get_updated_html();
|
||||
}
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes(
|
||||
array(
|
||||
'class' => $css_classes,
|
||||
'style' => $style_attribute,
|
||||
)
|
||||
);
|
||||
|
||||
$html .= sprintf(
|
||||
'<ul class="wp-block-navigation__submenu-container">%s</ul>',
|
||||
'<ul %s>%s</ul>',
|
||||
$wrapper_attributes,
|
||||
$inner_blocks_html
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
$html .= '</li>';
|
||||
|
||||
@@ -373,12 +373,14 @@ function block_core_navigation_get_most_recently_published_navigation() {
|
||||
|
||||
// Default to the most recently created menu.
|
||||
$parsed_args = array(
|
||||
'post_type' => 'wp_navigation',
|
||||
'no_found_rows' => true,
|
||||
'order' => 'DESC',
|
||||
'orderby' => 'date',
|
||||
'post_status' => 'publish',
|
||||
'posts_per_page' => 1, // get only the most recent.
|
||||
'post_type' => 'wp_navigation',
|
||||
'no_found_rows' => true,
|
||||
'update_post_meta_cache' => false,
|
||||
'update_post_term_cache' => false,
|
||||
'order' => 'DESC',
|
||||
'orderby' => 'date',
|
||||
'post_status' => 'publish',
|
||||
'posts_per_page' => 1, // get only the most recent.
|
||||
);
|
||||
|
||||
$navigation_post = new WP_Query( $parsed_args );
|
||||
|
||||
Reference in New Issue
Block a user