diff --git a/package.json b/package.json
index 3c93ef37f8c27..384f6937adbe1 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"url": "https://develop.svn.wordpress.org/trunk"
},
"gutenberg": {
- "sha": "98a796c8780c480ef7bcfe03c42302d9564d785c",
+ "sha": "233b6e89dbfd6a0ab379d0d55e714f62732df02a",
"ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build"
},
"engines": {
diff --git a/src/wp-includes/assets/script-loader-packages.php b/src/wp-includes/assets/script-loader-packages.php
index 4d71779a88fce..f49e071e9b9e7 100644
--- a/src/wp-includes/assets/script-loader-packages.php
+++ b/src/wp-includes/assets/script-loader-packages.php
@@ -66,7 +66,7 @@
'wp-theme',
'wp-url'
),
- 'version' => '13f742bc0bd8d649c08c'
+ 'version' => 'e9f5657e2c8598856bea'
),
'block-editor.js' => array(
'dependencies' => array(
@@ -104,7 +104,7 @@
'wp-url',
'wp-warning'
),
- 'version' => '037b9686399884c08637'
+ 'version' => 'b07414ddca958d94e162'
),
'block-library.js' => array(
'dependencies' => array(
@@ -149,7 +149,7 @@
'import' => 'dynamic'
)
),
- 'version' => 'bdc2f643328b35920a52'
+ 'version' => '0251bb0c00208eeacc8b'
),
'block-serialization-default-parser.js' => array(
'dependencies' => array(
@@ -182,7 +182,7 @@
'wp-shortcode',
'wp-warning'
),
- 'version' => '99de01fa6d78aee022f4'
+ 'version' => 'f6c0c9e6f9c6513de474'
),
'commands.js' => array(
'dependencies' => array(
@@ -198,7 +198,7 @@
'wp-primitives',
'wp-private-apis'
),
- 'version' => '8b8663311faa33540c1b'
+ 'version' => '747874d1f0a8fb7028cd'
),
'components.js' => array(
'dependencies' => array(
@@ -223,7 +223,7 @@
'wp-theme',
'wp-warning'
),
- 'version' => '693c237ae4066b1676f5'
+ 'version' => '72f54cbfff1cdbca6372'
),
'compose.js' => array(
'dependencies' => array(
@@ -238,7 +238,7 @@
'wp-private-apis',
'wp-undo-manager'
),
- 'version' => 'e234bbf2606001a9cdd3'
+ 'version' => 'd260e62d323fa8621a8b'
),
'core-commands.js' => array(
'dependencies' => array(
@@ -255,7 +255,7 @@
'wp-router',
'wp-url'
),
- 'version' => 'c387d70a2b85c37011a2'
+ 'version' => '8fc41d3503f7892d3ed8'
),
'core-data.js' => array(
'dependencies' => array(
@@ -276,7 +276,7 @@
'wp-url',
'wp-warning'
),
- 'version' => '526e825884ff5026978a'
+ 'version' => '068a17f7936cf62c5a0e'
),
'customize-widgets.js' => array(
'dependencies' => array(
@@ -305,7 +305,7 @@
'wp-theme',
'wp-widgets'
),
- 'version' => '0c48982a1d300208f58b'
+ 'version' => 'f28ae391ffd39b8db426'
),
'data.js' => array(
'dependencies' => array(
@@ -318,7 +318,7 @@
'wp-private-apis',
'wp-redux-routine'
),
- 'version' => '17619b19747bc3be28d6'
+ 'version' => 'c547bd40753de57cdc64'
),
'data-controls.js' => array(
'dependencies' => array(
@@ -395,7 +395,7 @@
'import' => 'static'
)
),
- 'version' => 'f8f08bd1bcba533df3b2'
+ 'version' => 'a37600ad00affd52f444'
),
'edit-site.js' => array(
'dependencies' => array(
@@ -444,7 +444,7 @@
'import' => 'static'
)
),
- 'version' => 'e548ea6abc3fd2dd3ad3'
+ 'version' => 'd84c3bce7be2aeeb33bc'
),
'edit-widgets.js' => array(
'dependencies' => array(
@@ -485,7 +485,7 @@
'import' => 'static'
)
),
- 'version' => '0a7901ee8e8f8c17db97'
+ 'version' => 'ecad0946a7d57d563d4d'
),
'editor.js' => array(
'dependencies' => array(
@@ -535,7 +535,7 @@
'import' => 'static'
)
),
- 'version' => '75814498d4961e5d6e62'
+ 'version' => '6d7326da970299924aa4'
),
'element.js' => array(
'dependencies' => array(
@@ -576,7 +576,7 @@
'import' => 'dynamic'
)
),
- 'version' => '89b2dd6a55cd5242fe1f'
+ 'version' => '3db8fb62268bf01981ba'
),
'hooks.js' => array(
'dependencies' => array(
@@ -615,7 +615,7 @@
'dependencies' => array(
'wp-i18n'
),
- 'version' => 'aa1a141e3468afe7f852'
+ 'version' => 'b156d58a707bff518176'
),
'list-reusable-blocks.js' => array(
'dependencies' => array(
@@ -654,7 +654,7 @@
'wp-url',
'wp-warning'
),
- 'version' => 'af846400ee8d1416963e'
+ 'version' => '883a9f0ee3ea34952e41'
),
'notices.js' => array(
'dependencies' => array(
@@ -673,6 +673,8 @@
),
'patterns.js' => array(
'dependencies' => array(
+ 'react',
+ 'react-dom',
'react-jsx-runtime',
'wp-a11y',
'wp-block-editor',
@@ -687,9 +689,10 @@
'wp-notices',
'wp-primitives',
'wp-private-apis',
+ 'wp-theme',
'wp-url'
),
- 'version' => 'e1c72298432c2ca51343'
+ 'version' => '0b1022e886ec7228e352'
),
'plugins.js' => array(
'dependencies' => array(
@@ -701,7 +704,7 @@
'wp-is-shallow-equal',
'wp-primitives'
),
- 'version' => 'fb81afeb7c472b9fb513'
+ 'version' => '3a4053e9678adcffdaf6'
),
'preferences.js' => array(
'dependencies' => array(
@@ -717,7 +720,7 @@
'wp-primitives',
'wp-private-apis'
),
- 'version' => '918930601e250eee727e'
+ 'version' => '5fb8895fcbaca4a09548'
),
'preferences-persistence.js' => array(
'dependencies' => array(
@@ -742,7 +745,7 @@
'dependencies' => array(
),
- 'version' => 'db306a8644da6d3146ac'
+ 'version' => 'ef613f9b176d6b77ee10'
),
'react-i18n.js' => array(
'dependencies' => array(
@@ -772,7 +775,7 @@
'wp-primitives',
'wp-url'
),
- 'version' => '372c845659b9a298e4fb'
+ 'version' => 'dedb515a74e4b393c939'
),
'rich-text.js' => array(
'dependencies' => array(
@@ -787,7 +790,7 @@
'wp-keycodes',
'wp-private-apis'
),
- 'version' => 'da75f56985c87415ce86'
+ 'version' => '841e5f1800d731a7a992'
),
'router.js' => array(
'dependencies' => array(
@@ -823,7 +826,7 @@
'dependencies' => array(
),
- 'version' => '10a88969c2fbccc89f91'
+ 'version' => '50b0461aa90d44c4123b'
),
'sync.js' => array(
'dependencies' => array(
@@ -836,10 +839,12 @@
'theme.js' => array(
'dependencies' => array(
'react-jsx-runtime',
+ 'wp-compose',
+ 'wp-deprecated',
'wp-element',
'wp-private-apis'
),
- 'version' => '6a8c2c1a082df70216ad'
+ 'version' => '0751ba62cc9198c11d9c'
),
'token-list.js' => array(
'dependencies' => array(
@@ -870,7 +875,7 @@
'import' => 'dynamic'
)
),
- 'version' => 'c3362866e191c81cdc90'
+ 'version' => '74f79b5e0e8cf90eb161'
),
'url.js' => array(
'dependencies' => array(
@@ -907,12 +912,12 @@
'wp-notices',
'wp-primitives'
),
- 'version' => '3ab93e442c755a6b2b4e'
+ 'version' => 'ae3ceae52d4cad341a06'
),
'wordcount.js' => array(
'dependencies' => array(
),
- 'version' => '3b928d5db8724a8614dd'
+ 'version' => 'f53ba7c5b085d7a53357'
)
);
\ No newline at end of file
diff --git a/src/wp-includes/assets/script-modules-packages.php b/src/wp-includes/assets/script-modules-packages.php
index 927010b7128d6..611b6ef9c596d 100644
--- a/src/wp-includes/assets/script-modules-packages.php
+++ b/src/wp-includes/assets/script-modules-packages.php
@@ -3,7 +3,7 @@
'dependencies' => array(
),
- 'version' => '1c371cb517a97cdbcb9f'
+ 'version' => 'f62f48906198ea8abc60'
),
'abilities/index.js' => array(
'dependencies' => array(
@@ -22,7 +22,7 @@
'import' => 'static'
)
),
- 'version' => '383c7a8bd24a1f2fd9b9'
+ 'version' => 'f465b12ad4eba72e96bb'
),
'block-library/accordion/view.js' => array(
'dependencies' => array(
@@ -128,7 +128,7 @@
'import' => 'static'
)
),
- 'version' => '1f60dd5e3fa56c6b2e2e'
+ 'version' => '581cf5c9168a7665f2dd'
),
'boot/index.js' => array(
'dependencies' => array(
@@ -166,7 +166,7 @@
'import' => 'static'
)
),
- 'version' => 'ee45059f83b6c49290ed'
+ 'version' => 'c6634581241bc443d56e'
),
'connectors/index.js' => array(
'dependencies' => array(
@@ -177,7 +177,7 @@
'wp-i18n',
'wp-private-apis'
),
- 'version' => '753a649aa400199df0fd'
+ 'version' => '926e925ff16c07ab7719'
),
'content-types/index.js' => array(
'dependencies' => array(
@@ -212,7 +212,7 @@
'import' => 'static'
)
),
- 'version' => 'b022ce0e97e0c8c91ce3'
+ 'version' => '40b1a1f29a8660911fcd'
),
'core-abilities/index.js' => array(
'dependencies' => array(
@@ -227,6 +227,14 @@
),
'version' => 'ed8d088084da397754c1'
),
+ 'dashboard-init/index.js' => array(
+ 'dependencies' => array(
+ 'wp-core-data',
+ 'wp-data',
+ 'wp-i18n'
+ ),
+ 'version' => 'dfe923ac4bd0bd01b9aa'
+ ),
'edit-site-init/index.js' => array(
'dependencies' => array(
'react-jsx-runtime',
@@ -240,7 +248,7 @@
'import' => 'static'
)
),
- 'version' => '03b5e26742d2806990c6'
+ 'version' => '95c8e950f9c99feb5d09'
),
'interactivity/index.js' => array(
'dependencies' => array(
@@ -280,7 +288,7 @@
'dependencies' => array(
),
- 'version' => 'e5fd3ae6d2c3b6e669da'
+ 'version' => '662cb0e7f68d2a21cd68'
),
'latex-to-mathml/loader.js' => array(
'dependencies' => array(
@@ -308,7 +316,7 @@
'wp-private-apis',
'wp-style-engine'
),
- 'version' => 'e9a1d3da960d762c5954'
+ 'version' => '20ca41c3076613678aa6'
),
'route/index.js' => array(
'dependencies' => array(
@@ -317,7 +325,7 @@
'react-jsx-runtime',
'wp-private-apis'
),
- 'version' => '48a77bfa70722b4254e4'
+ 'version' => 'ef851c0f4dda0d1dd359'
),
'vips/loader.js' => array(
'dependencies' => array(
@@ -335,7 +343,7 @@
'dependencies' => array(
),
- 'version' => '4972ce7ba840491f17bb'
+ 'version' => 'bef00f6d1e2a86eb1050'
),
'workflow/index.js' => array(
'dependencies' => array(
@@ -360,6 +368,6 @@
'import' => 'static'
)
),
- 'version' => 'c5983b82ce036952b349'
+ 'version' => '3f33e12236a7f59f00ae'
)
);
\ No newline at end of file
diff --git a/src/wp-includes/blocks/avatar.php b/src/wp-includes/blocks/avatar.php
index 7f73370973d42..196d67a4d480c 100644
--- a/src/wp-includes/blocks/avatar.php
+++ b/src/wp-includes/blocks/avatar.php
@@ -67,7 +67,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
// translators: 1: Author archive link. 2: Link target. %3$s Aria label. %4$s Avatar image.
$avatar_block = sprintf( '%4$s', esc_url( get_author_posts_url( $author_id ) ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
}
- return sprintf( '
%2s
', $wrapper_attributes, $avatar_block );
+ return sprintf( '%2$s
', $wrapper_attributes, $avatar_block );
}
$comment = get_comment( $block->context['commentId'] );
if ( ! $comment ) {
@@ -93,7 +93,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
}
$avatar_block = sprintf( '%4$s', esc_url( $comment->comment_author_url ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
}
- return sprintf( '%2s
', $wrapper_attributes, $avatar_block );
+ return sprintf( '%2$s
', $wrapper_attributes, $avatar_block );
}
/**
diff --git a/src/wp-includes/blocks/block.php b/src/wp-includes/blocks/block.php
index f09d5367a9c89..a89facf7be9a5 100644
--- a/src/wp-includes/blocks/block.php
+++ b/src/wp-includes/blocks/block.php
@@ -1,4 +1,4 @@
-parsed_block['innerBlocks'] = parse_blocks( $content );
$block_instance->parsed_block['innerContent'] = array_fill( 0, count( $block_instance->parsed_block['innerBlocks'] ), null );
- if ( method_exists( $block_instance, 'refresh_context_dependents' ) ) {
- // WP_Block::refresh_context_dependents() was introduced in WordPress 6.8.
- $block_instance->refresh_context_dependents();
- } else {
- // This branch can be removed once Gutenberg requires WordPress 6.8 or later.
- if ( ! class_exists( 'WP_Block_Cloner' ) ) {
- // phpcs:ignore Gutenberg.Commenting.SinceTag.MissingClassSinceTag
- class WP_Block_Cloner extends WP_Block {
- /**
- * Static methods of subclasses have access to protected properties
- * of instances of the parent class.
- * In this case, this gives us access to `available_context` and `registry`.
- */
- // phpcs:ignore Gutenberg.Commenting.SinceTag.MissingMethodSinceTag
- public static function clone_instance( $instance ) {
- return new WP_Block(
- $instance->parsed_block,
- $instance->available_context,
- $instance->registry
- );
- }
- }
- }
- $block_instance = WP_Block_Cloner::clone_instance( $block_instance );
- }
+ $block_instance->refresh_context_dependents();
$content = $block_instance->render( array( 'dynamic' => false ) );
unset( $seen_refs[ $attributes['ref'] ] );
diff --git a/src/wp-includes/blocks/blocks-json.php b/src/wp-includes/blocks/blocks-json.php
index 1f61f615b6dfa..d1e1552d0570d 100644
--- a/src/wp-includes/blocks/blocks-json.php
+++ b/src/wp-includes/blocks/blocks-json.php
@@ -3136,6 +3136,18 @@
'icon' => array(
'type' => 'string',
'role' => 'content'
+ ),
+ 'flipHorizontal' => array(
+ 'type' => 'boolean',
+ 'default' => false
+ ),
+ 'flipVertical' => array(
+ 'type' => 'boolean',
+ 'default' => false
+ ),
+ 'rotation' => array(
+ 'type' => 'number',
+ 'default' => 0
)
),
'supports' => array(
@@ -3354,6 +3366,7 @@
)
),
'selectors' => array(
+ 'dimensions' => '.wp-block-image img',
'border' => '.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder',
'shadow' => '.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder',
'filter' => array(
@@ -4406,7 +4419,7 @@
),
'selectors' => array(
'states' => array(
- '@current' => '.wp-block-navigation .current-menu-item'
+ '-current' => '.wp-block-navigation .current-menu-item'
)
),
'editorStyle' => 'wp-block-navigation-link-editor',
@@ -4514,8 +4527,15 @@
),
'isTopLevelItem' => array(
'type' => 'boolean'
+ ),
+ 'isParentSubmenu' => array(
+ 'type' => 'boolean',
+ 'default' => true
)
),
+ 'providesContext' => array(
+ 'core/isInsideSubmenu' => 'isParentSubmenu'
+ ),
'usesContext' => array(
'textColor',
'customTextColor',
@@ -4603,10 +4623,6 @@
'parentPageID' => array(
'type' => 'integer',
'default' => 0
- ),
- 'isNested' => array(
- 'type' => 'boolean',
- 'default' => false
)
),
'usesContext' => array(
@@ -4623,7 +4639,8 @@
'showSubmenuIcon',
'style',
'openSubmenusOnClick',
- 'submenuVisibility'
+ 'submenuVisibility',
+ 'core/isInsideSubmenu'
),
'supports' => array(
'anchor' => true,
@@ -5633,6 +5650,7 @@
)
),
'selectors' => array(
+ 'dimensions' => '.wp-block-post-featured-image img',
'border' => '.wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay',
'shadow' => '.wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder',
'filter' => array(
@@ -6110,9 +6128,6 @@
'source' => 'rich-text',
'selector' => 'cite',
'role' => 'content'
- ),
- 'textAlign' => array(
- 'type' => 'string'
)
),
'supports' => array(
@@ -6149,6 +6164,7 @@
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
+ 'textAlign' => true,
'__experimentalFontFamily' => true,
'__experimentalFontWeight' => true,
'__experimentalFontStyle' => true,
@@ -7005,6 +7021,10 @@
'default' => array(
)
+ ),
+ 'tagName' => array(
+ 'type' => 'string',
+ 'default' => ''
)
),
'supports' => array(
diff --git a/src/wp-includes/blocks/comment-author-name.php b/src/wp-includes/blocks/comment-author-name.php
index 2f9227964ad44..d1517c681cc19 100644
--- a/src/wp-includes/blocks/comment-author-name.php
+++ b/src/wp-includes/blocks/comment-author-name.php
@@ -40,7 +40,7 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
$link = get_comment_author_url( $comment );
if ( ! empty( $link ) && ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
- $comment_author = sprintf( '%3s', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
+ $comment_author = sprintf( '%3$s', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
}
if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
$comment_author = wp_kses( $comment_author, array() );
diff --git a/src/wp-includes/blocks/comment-date.php b/src/wp-includes/blocks/comment-date.php
index bdb6fd5ba42ae..7856e132404a8 100644
--- a/src/wp-includes/blocks/comment-date.php
+++ b/src/wp-includes/blocks/comment-date.php
@@ -37,7 +37,7 @@ function render_block_core_comment_date( $attributes, $content, $block ) {
$link = get_comment_link( $comment );
if ( ! empty( $attributes['isLink'] ) ) {
- $formatted_date = sprintf( '%2s', esc_url( $link ), $formatted_date );
+ $formatted_date = sprintf( '%2$s', esc_url( $link ), $formatted_date );
}
return sprintf(
diff --git a/src/wp-includes/blocks/icon.php b/src/wp-includes/blocks/icon.php
index 1b7a27a147698..205cd397d7c42 100644
--- a/src/wp-includes/blocks/icon.php
+++ b/src/wp-includes/blocks/icon.php
@@ -96,6 +96,29 @@ function render_block_core_icon( $attributes ) {
$processor->add_class( $styles['classnames'] );
}
+ // Apply flip classes to the SVG.
+ $flip_horizontal = $attributes['flipHorizontal'] ?? false;
+ $flip_vertical = $attributes['flipVertical'] ?? false;
+
+ if ( $flip_horizontal ) {
+ $processor->add_class( 'is-flip-horizontal' );
+ }
+ if ( $flip_vertical ) {
+ $processor->add_class( 'is-flip-vertical' );
+ }
+
+ $rotation = isset( $attributes['rotation'] ) ? (int) $attributes['rotation'] : 0;
+
+ if ( $rotation ) {
+ $current_style = $processor->get_attribute( 'style' ) ?? '';
+ $rotation_css = 'rotate: ' . $rotation . 'deg;';
+ if ( $current_style ) {
+ $processor->set_attribute( 'style', $current_style . ' ' . $rotation_css );
+ } else {
+ $processor->set_attribute( 'style', $rotation_css );
+ }
+ }
+
$aria_label = ! empty( $attributes['ariaLabel'] ) ? $attributes['ariaLabel'] : '';
if ( ! $aria_label ) {
diff --git a/src/wp-includes/blocks/icon/block.json b/src/wp-includes/blocks/icon/block.json
index 23d0f10dc4b26..f0dd4bb4018f3 100644
--- a/src/wp-includes/blocks/icon/block.json
+++ b/src/wp-includes/blocks/icon/block.json
@@ -11,6 +11,18 @@
"icon": {
"type": "string",
"role": "content"
+ },
+ "flipHorizontal": {
+ "type": "boolean",
+ "default": false
+ },
+ "flipVertical": {
+ "type": "boolean",
+ "default": false
+ },
+ "rotation": {
+ "type": "number",
+ "default": 0
}
},
"supports": {
diff --git a/src/wp-includes/blocks/image.php b/src/wp-includes/blocks/image.php
index 5aa42bb48ab98..dff0f19541794 100644
--- a/src/wp-includes/blocks/image.php
+++ b/src/wp-includes/blocks/image.php
@@ -390,7 +390,6 @@ class="wp-lightbox-overlay zoom"
data-wp-bind--style="state.imgStyles"
data-wp-bind--src="state.enlargedSrc"
data-wp-bind--srcset="state.enlargedSrcset"
- data-wp-bind--srcset="state.enlargedSrcset"
sizes="100vw"
>
diff --git a/src/wp-includes/blocks/image/block.json b/src/wp-includes/blocks/image/block.json
index 31c4873fe3b7a..a8879d4258480 100644
--- a/src/wp-includes/blocks/image/block.json
+++ b/src/wp-includes/blocks/image/block.json
@@ -141,6 +141,7 @@
}
},
"selectors": {
+ "dimensions": ".wp-block-image img",
"border": ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",
"shadow": ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",
"filter": {
diff --git a/src/wp-includes/blocks/navigation-link/block.json b/src/wp-includes/blocks/navigation-link/block.json
index 0735461d0b29a..8cab34bc4d064 100644
--- a/src/wp-includes/blocks/navigation-link/block.json
+++ b/src/wp-includes/blocks/navigation-link/block.json
@@ -87,7 +87,7 @@
},
"selectors": {
"states": {
- "@current": ".wp-block-navigation .current-menu-item"
+ "-current": ".wp-block-navigation .current-menu-item"
}
},
"editorStyle": "wp-block-navigation-link-editor",
diff --git a/src/wp-includes/blocks/navigation-submenu/block.json b/src/wp-includes/blocks/navigation-submenu/block.json
index b11aba479ce13..7dde393be1759 100644
--- a/src/wp-includes/blocks/navigation-submenu/block.json
+++ b/src/wp-includes/blocks/navigation-submenu/block.json
@@ -40,8 +40,15 @@
},
"isTopLevelItem": {
"type": "boolean"
+ },
+ "isParentSubmenu": {
+ "type": "boolean",
+ "default": true
}
},
+ "providesContext": {
+ "core/isInsideSubmenu": "isParentSubmenu"
+ },
"usesContext": [
"textColor",
"customTextColor",
diff --git a/src/wp-includes/blocks/navigation.php b/src/wp-includes/blocks/navigation.php
index a530494ff36e7..eb960636b9f25 100644
--- a/src/wp-includes/blocks/navigation.php
+++ b/src/wp-includes/blocks/navigation.php
@@ -1557,6 +1557,64 @@ function register_block_core_navigation() {
add_action( 'init', 'register_block_core_navigation' );
+/**
+ * Adds the Navigation block state class to inner list containers.
+ *
+ * State block support adds the generated `wp-states-*` class to the outer
+ * block wrapper. The Navigation block renders its menu items inside an inner
+ * `wp-block-navigation__container` list, so the same state class is also needed
+ * there for state styles to apply directly to the menu list.
+ *
+ * Currently this is required as a workaround because of how difficult it is for nav
+ * child blocks to inherit styles through the complex responsive nav block html. The
+ * bug in https://github.com/WordPress/gutenberg/issues/62690 also prevents inheritance.
+ *
+ * @since 7.1.0
+ *
+ * @param string $block_content The block content.
+ * @param array $block The full block, including name and attributes.
+ * @return string The updated block content.
+ */
+function block_core_navigation_add_state_class_to_container( $block_content, $block ) {
+ if ( 'core/navigation' !== ( $block['blockName'] ?? null ) || empty( $block_content ) ) {
+ return $block_content;
+ }
+
+ $processor = new WP_HTML_Tag_Processor( $block_content );
+ if ( ! $processor->next_tag() ) {
+ return $block_content;
+ }
+
+ $class_attribute = $processor->get_attribute( 'class' );
+ if ( ! is_string( $class_attribute ) || ! preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute, $matches ) ) {
+ return $block_content;
+ }
+
+ $state_class = $matches[0];
+ while ( $processor->next_tag() ) {
+ // Custom overlay content can include nested Navigation blocks.
+ // Avoid applying the outer Navigation state class to an inner nav block.
+ if ( $processor->has_class( 'wp-block-navigation' ) && ! $processor->has_class( 'wp-block-navigation__container' ) ) {
+ break;
+ }
+
+ if ( ! $processor->has_class( 'wp-block-navigation__container' ) ) {
+ continue;
+ }
+
+ $class_attribute = $processor->get_attribute( 'class' );
+ if ( is_string( $class_attribute ) && preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute ) ) {
+ continue;
+ }
+
+ $processor->add_class( $state_class );
+ }
+
+ return $processor->get_updated_html();
+}
+
+add_filter( 'render_block', 'block_core_navigation_add_state_class_to_container', 11, 2 );
+
/**
* Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly.
*
diff --git a/src/wp-includes/blocks/page-list.php b/src/wp-includes/blocks/page-list.php
index a6ed5938d969e..6dd368f8c8d43 100644
--- a/src/wp-includes/blocks/page-list.php
+++ b/src/wp-includes/blocks/page-list.php
@@ -259,7 +259,7 @@ function render_block_core_page_list( $attributes, $content, $block ) {
++$block_id;
$parent_page_id = $attributes['parentPageID'];
- $is_nested = $attributes['isNested'];
+ $is_nested = ! empty( $block->context['core/isInsideSubmenu'] );
$all_pages = get_pages(
array(
diff --git a/src/wp-includes/blocks/page-list/block.json b/src/wp-includes/blocks/page-list/block.json
index 2b97f248c5768..ebd5dd6c1565c 100644
--- a/src/wp-includes/blocks/page-list/block.json
+++ b/src/wp-includes/blocks/page-list/block.json
@@ -12,10 +12,6 @@
"parentPageID": {
"type": "integer",
"default": 0
- },
- "isNested": {
- "type": "boolean",
- "default": false
}
},
"usesContext": [
@@ -32,7 +28,8 @@
"showSubmenuIcon",
"style",
"openSubmenusOnClick",
- "submenuVisibility"
+ "submenuVisibility",
+ "core/isInsideSubmenu"
],
"supports": {
"anchor": true,
diff --git a/src/wp-includes/blocks/post-featured-image.php b/src/wp-includes/blocks/post-featured-image.php
index 0b0a0655c6c4f..536de7e1448e8 100644
--- a/src/wp-includes/blocks/post-featured-image.php
+++ b/src/wp-includes/blocks/post-featured-image.php
@@ -40,16 +40,26 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
}
$extra_styles = '';
+ $has_width = array_key_exists( 'width', $attributes ) && null !== $attributes['width'] && '' !== $attributes['width'];
+ $has_height = array_key_exists( 'height', $attributes ) && null !== $attributes['height'] && '' !== $attributes['height'];
- // Aspect ratio with a height set needs to override the default width/height.
if ( ! empty( $attributes['aspectRatio'] ) ) {
- $extra_styles .= 'width:100%;height:100%;';
- } elseif ( ! empty( $attributes['height'] ) ) {
- $extra_styles .= "height:{$attributes['height']};";
+ $extra_styles .= esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';';
+ $extra_styles .= 'width:100%;';
+ }
+
+ if ( $has_height ) {
+ $extra_styles .= esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';';
+ } elseif ( $has_width ) {
+ $extra_styles .= 'height:auto;';
+ }
+
+ if ( $has_width ) {
+ $extra_styles .= esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';';
}
if ( ! empty( $attributes['scale'] ) ) {
- $extra_styles .= "object-fit:{$attributes['scale']};";
+ $extra_styles .= esc_attr( safecss_filter_attr( 'object-fit:' . $attributes['scale'] ) ) . ';';
}
if ( ! empty( $attributes['style']['shadow'] ) ) {
$shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ) );
@@ -90,6 +100,13 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
foreach ( $processor->get_attribute_names_with_prefix( '' ) as $name ) {
$tag_html->set_attribute( $name, $processor->get_attribute( $name ) );
}
+ if ( ! empty( $attr['style'] ) ) {
+ $existing_style = $tag_html->get_attribute( 'style' );
+ $style = is_string( $existing_style ) && '' !== $existing_style
+ ? rtrim( $existing_style, ';' ) . ';' . $attr['style']
+ : $attr['style'];
+ $tag_html->set_attribute( 'style', $style );
+ }
$featured_image = $tag_html->get_updated_html();
}
}
@@ -101,13 +118,11 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
if ( $is_link ) {
$link_target = $attributes['linkTarget'];
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
- $height = ! empty( $attributes['height'] ) ? 'style="' . esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . '"' : '';
$featured_image = sprintf(
- '%5$s%6$s',
+ '%4$s%5$s',
esc_url( get_the_permalink( $post_ID ) ),
esc_attr( $link_target ),
$rel,
- $height,
$featured_image,
$overlay_markup
);
@@ -115,20 +130,7 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
$featured_image = $featured_image . $overlay_markup;
}
- $aspect_ratio = ! empty( $attributes['aspectRatio'] )
- ? esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';'
- : '';
- $width = ! empty( $attributes['width'] )
- ? esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';'
- : '';
- $height = ! empty( $attributes['height'] )
- ? esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';'
- : '';
- if ( ! $height && ! $width && ! $aspect_ratio ) {
- $wrapper_attributes = get_block_wrapper_attributes();
- } else {
- $wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height ) );
- }
+ $wrapper_attributes = get_block_wrapper_attributes();
return "{$featured_image}";
}
diff --git a/src/wp-includes/blocks/post-featured-image/block.json b/src/wp-includes/blocks/post-featured-image/block.json
index f5619dc29fac5..72332d2d1d1e7 100644
--- a/src/wp-includes/blocks/post-featured-image/block.json
+++ b/src/wp-includes/blocks/post-featured-image/block.json
@@ -98,6 +98,7 @@
}
},
"selectors": {
+ "dimensions": ".wp-block-post-featured-image img",
"border": ".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay",
"shadow": ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder",
"filter": {
diff --git a/src/wp-includes/blocks/pullquote/block.json b/src/wp-includes/blocks/pullquote/block.json
index 9469f420d1db7..8bacc90dcd0ab 100644
--- a/src/wp-includes/blocks/pullquote/block.json
+++ b/src/wp-includes/blocks/pullquote/block.json
@@ -18,9 +18,6 @@
"source": "rich-text",
"selector": "cite",
"role": "content"
- },
- "textAlign": {
- "type": "string"
}
},
"supports": {
@@ -52,6 +49,7 @@
"typography": {
"fontSize": true,
"lineHeight": true,
+ "textAlign": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
diff --git a/src/wp-includes/blocks/search.php b/src/wp-includes/blocks/search.php
index 07c051b8f6eb9..8811e005e7f01 100644
--- a/src/wp-includes/blocks/search.php
+++ b/src/wp-includes/blocks/search.php
@@ -191,8 +191,32 @@ function render_block_core_search( $attributes ) {
';
}
+ /*
+ * The semantic landmark wrapper is opt-in to preserve back
+ * compatibility with themes targeting