diff --git a/package.json b/package.json
index 430efdd2fba85..4bb41a980e531 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"url": "https://develop.svn.wordpress.org/trunk"
},
"gutenberg": {
- "sha": "a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd",
+ "sha": "7c2994dec76b860b7d88c19a456fbd8db8526de5",
"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 5dccb121dbb83..afa3e425061d6 100644
--- a/src/wp-includes/assets/script-loader-packages.php
+++ b/src/wp-includes/assets/script-loader-packages.php
@@ -4,7 +4,7 @@
'wp-dom-ready',
'wp-i18n'
),
- 'version' => 'af934e5259bc51b8718e'
+ 'version' => '483af07a6016f640f456'
),
'annotations.js' => array(
'dependencies' => array(
@@ -13,14 +13,15 @@
'wp-i18n',
'wp-rich-text'
),
- 'version' => '4b07d06c67c3b5ea590c'
+ 'version' => 'd4fe1eeb787c2fd5ee89'
),
'api-fetch.js' => array(
'dependencies' => array(
'wp-i18n',
+ 'wp-private-apis',
'wp-url'
),
- 'version' => 'd7efe4dc1468d36c39b8'
+ 'version' => 'b5b51750518787a93005'
),
'autop.js' => array(
'dependencies' => array(
@@ -42,6 +43,8 @@
),
'block-directory.js' => array(
'dependencies' => array(
+ 'react',
+ 'react-dom',
'react-jsx-runtime',
'wp-a11y',
'wp-api-fetch',
@@ -59,9 +62,11 @@
'wp-notices',
'wp-plugins',
'wp-primitives',
+ 'wp-private-apis',
+ 'wp-theme',
'wp-url'
),
- 'version' => '23207f52d0d266f6e1c4'
+ 'version' => '73ae241f079f4ca777e0'
),
'block-editor.js' => array(
'dependencies' => array(
@@ -69,7 +74,6 @@
'react-dom',
'react-jsx-runtime',
'wp-a11y',
- 'wp-api-fetch',
'wp-blob',
'wp-block-serialization-default-parser',
'wp-blocks',
@@ -100,11 +104,12 @@
'wp-url',
'wp-warning'
),
- 'version' => '93c3566b7f24c15b7e17'
+ 'version' => '495bc7e0f12962323735'
),
'block-library.js' => array(
'dependencies' => array(
'react',
+ 'react-dom',
'react-jsx-runtime',
'wp-a11y',
'wp-api-fetch',
@@ -132,6 +137,8 @@
'wp-private-apis',
'wp-rich-text',
'wp-server-side-render',
+ 'wp-shortcode',
+ 'wp-theme',
'wp-upload-media',
'wp-url',
'wp-wordcount'
@@ -142,7 +149,7 @@
'import' => 'dynamic'
)
),
- 'version' => '2dffdfe77b9c5cba960e'
+ 'version' => '904bfd65fc0272474e04'
),
'block-serialization-default-parser.js' => array(
'dependencies' => array(
@@ -175,7 +182,7 @@
'wp-shortcode',
'wp-warning'
),
- 'version' => 'ef38e42500165bfda301'
+ 'version' => '2ee91c280141de25ebf0'
),
'commands.js' => array(
'dependencies' => array(
@@ -187,10 +194,11 @@
'wp-element',
'wp-i18n',
'wp-keyboard-shortcuts',
+ 'wp-preferences',
'wp-primitives',
'wp-private-apis'
),
- 'version' => 'e3d8bba53f4ffea4fcd2'
+ 'version' => '8b8663311faa33540c1b'
),
'components.js' => array(
'dependencies' => array(
@@ -212,9 +220,10 @@
'wp-primitives',
'wp-private-apis',
'wp-rich-text',
+ 'wp-theme',
'wp-warning'
),
- 'version' => '5dedfe13f08880193a28'
+ 'version' => 'ae50cdf11fbc575d2b51'
),
'compose.js' => array(
'dependencies' => array(
@@ -226,9 +235,10 @@
'wp-is-shallow-equal',
'wp-keycodes',
'wp-priority-queue',
+ 'wp-private-apis',
'wp-undo-manager'
),
- 'version' => 'edb5a8c0b5bf71686403'
+ 'version' => 'e234bbf2606001a9cdd3'
),
'core-commands.js' => array(
'dependencies' => array(
@@ -245,7 +255,7 @@
'wp-router',
'wp-url'
),
- 'version' => 'b209152e7e51279d7c28'
+ 'version' => 'c387d70a2b85c37011a2'
),
'core-data.js' => array(
'dependencies' => array(
@@ -257,20 +267,23 @@
'wp-data',
'wp-deprecated',
'wp-element',
- 'wp-hooks',
'wp-html-entities',
'wp-i18n',
'wp-private-apis',
'wp-rich-text',
+ 'wp-sync',
'wp-undo-manager',
'wp-url',
'wp-warning'
),
- 'version' => '89931f90e4df5eb5f8a3'
+ 'version' => 'b0a7e67392467257625e'
),
'customize-widgets.js' => array(
'dependencies' => array(
+ 'react',
+ 'react-dom',
'react-jsx-runtime',
+ 'wp-a11y',
'wp-block-editor',
'wp-block-library',
'wp-blocks',
@@ -289,9 +302,10 @@
'wp-preferences',
'wp-primitives',
'wp-private-apis',
+ 'wp-theme',
'wp-widgets'
),
- 'version' => '524dc7a4326b77064831'
+ 'version' => '0c48982a1d300208f58b'
),
'data.js' => array(
'dependencies' => array(
@@ -304,7 +318,7 @@
'wp-private-apis',
'wp-redux-routine'
),
- 'version' => '1756b6a2676c1b3369ab'
+ 'version' => 'c547bd40753de57cdc64'
),
'data-controls.js' => array(
'dependencies' => array(
@@ -319,7 +333,7 @@
'moment',
'wp-deprecated'
),
- 'version' => 'c9f8e7dd3232716f34e9'
+ 'version' => '2faaf49020b2074de156'
),
'deprecated.js' => array(
'dependencies' => array(
@@ -331,7 +345,7 @@
'dependencies' => array(
'wp-deprecated'
),
- 'version' => '66a6cf58e0c4cd128af0'
+ 'version' => 'ea68e9ed0a44f0e21a67'
),
'dom-ready.js' => array(
'dependencies' => array(
@@ -381,7 +395,7 @@
'import' => 'static'
)
),
- 'version' => '28ef50b859708963e197'
+ 'version' => '36f5eee7d89b06645546'
),
'edit-site.js' => array(
'dependencies' => array(
@@ -409,6 +423,7 @@
'wp-i18n',
'wp-keyboard-shortcuts',
'wp-keycodes',
+ 'wp-media-utils',
'wp-notices',
'wp-patterns',
'wp-plugins',
@@ -420,7 +435,8 @@
'wp-theme',
'wp-url',
'wp-warning',
- 'wp-widgets'
+ 'wp-widgets',
+ 'wp-wordcount'
),
'module_dependencies' => array(
array(
@@ -428,7 +444,7 @@
'import' => 'static'
)
),
- 'version' => 'dfd078032a67983c4d32'
+ 'version' => '6e5fedb5456e02f21087'
),
'edit-widgets.js' => array(
'dependencies' => array(
@@ -469,7 +485,7 @@
'import' => 'static'
)
),
- 'version' => '899c5ac5dcb94e19d378'
+ 'version' => '0a7901ee8e8f8c17db97'
),
'editor.js' => array(
'dependencies' => array(
@@ -519,7 +535,7 @@
'import' => 'static'
)
),
- 'version' => '37faadbdf6c40cb0c71c'
+ 'version' => '1e4e3134648fa5fc5e7c'
),
'element.js' => array(
'dependencies' => array(
@@ -527,7 +543,7 @@
'react-dom',
'wp-escape-html'
),
- 'version' => '15ba804677f72a8db97b'
+ 'version' => 'ce395381f7d64d2a6d71'
),
'escape-html.js' => array(
'dependencies' => array(
@@ -537,6 +553,8 @@
),
'format-library.js' => array(
'dependencies' => array(
+ 'react',
+ 'react-dom',
'react-jsx-runtime',
'wp-a11y',
'wp-block-editor',
@@ -549,6 +567,7 @@
'wp-primitives',
'wp-private-apis',
'wp-rich-text',
+ 'wp-theme',
'wp-url'
),
'module_dependencies' => array(
@@ -557,7 +576,7 @@
'import' => 'dynamic'
)
),
- 'version' => 'f89be9586f2d9ce4545a'
+ 'version' => '9227459993502b2afce7'
),
'hooks.js' => array(
'dependencies' => array(
@@ -575,7 +594,7 @@
'dependencies' => array(
'wp-hooks'
),
- 'version' => '781d11515ad3d91786ec'
+ 'version' => '125448662852c5e18937'
),
'is-shallow-equal.js' => array(
'dependencies' => array(
@@ -590,7 +609,7 @@
'wp-element',
'wp-keycodes'
),
- 'version' => '2ed78d3b4c23f38804e0'
+ 'version' => '0dd268b2132a3f82b1d4'
),
'keycodes.js' => array(
'dependencies' => array(
@@ -608,7 +627,7 @@
'wp-element',
'wp-i18n'
),
- 'version' => '2e35ebd5dbaccb5a90c5'
+ 'version' => 'a44da9be02cdfef6e44d'
),
'media-utils.js' => array(
'dependencies' => array(
@@ -628,13 +647,14 @@
'wp-i18n',
'wp-keycodes',
'wp-notices',
+ 'wp-preferences',
'wp-primitives',
'wp-private-apis',
'wp-theme',
'wp-url',
'wp-warning'
),
- 'version' => '85f1375ab5f23cd5d13c'
+ 'version' => '399783506c464f6e2aab'
),
'notices.js' => array(
'dependencies' => array(
@@ -642,20 +662,14 @@
'wp-components',
'wp-data'
),
- 'version' => '218d0173a31ae7269246'
+ 'version' => '505026883bbd05994872'
),
'nux.js' => array(
'dependencies' => array(
- 'react-jsx-runtime',
- 'wp-components',
- 'wp-compose',
'wp-data',
- 'wp-deprecated',
- 'wp-element',
- 'wp-i18n',
- 'wp-primitives'
+ 'wp-deprecated'
),
- 'version' => '14d2335a0007b36b9112'
+ 'version' => 'b0afe722eacfd6e9a364'
),
'patterns.js' => array(
'dependencies' => array(
@@ -675,7 +689,7 @@
'wp-private-apis',
'wp-url'
),
- 'version' => '714c49ed2942c98d088f'
+ 'version' => '370c242827f36de944f5'
),
'plugins.js' => array(
'dependencies' => array(
@@ -687,7 +701,7 @@
'wp-is-shallow-equal',
'wp-primitives'
),
- 'version' => '72e3cf01c2b3535a9432'
+ 'version' => 'fb81afeb7c472b9fb513'
),
'preferences.js' => array(
'dependencies' => array(
@@ -703,7 +717,7 @@
'wp-primitives',
'wp-private-apis'
),
- 'version' => '035813168e404aa30193'
+ 'version' => '918930601e250eee727e'
),
'preferences-persistence.js' => array(
'dependencies' => array(
@@ -728,7 +742,7 @@
'dependencies' => array(
),
- 'version' => '835912f0086b9e59aed4'
+ 'version' => 'db306a8644da6d3146ac'
),
'react-i18n.js' => array(
'dependencies' => array(
@@ -758,7 +772,7 @@
'wp-primitives',
'wp-url'
),
- 'version' => '21d86e46535b79d9afda'
+ 'version' => '372c845659b9a298e4fb'
),
'rich-text.js' => array(
'dependencies' => array(
@@ -773,7 +787,7 @@
'wp-keycodes',
'wp-private-apis'
),
- 'version' => '16449e6108f48327f368'
+ 'version' => 'da75f56985c87415ce86'
),
'router.js' => array(
'dependencies' => array(
@@ -797,7 +811,7 @@
'wp-i18n',
'wp-url'
),
- 'version' => '10a51bf05ced35b78092'
+ 'version' => '48cee6850e8be3502509'
),
'shortcode.js' => array(
'dependencies' => array(
@@ -809,7 +823,15 @@
'dependencies' => array(
),
- 'version' => 'faa37ce61b7ec8394b2a'
+ 'version' => 'b2c79081dde904761e72'
+ ),
+ 'sync.js' => array(
+ 'dependencies' => array(
+ 'wp-api-fetch',
+ 'wp-hooks',
+ 'wp-private-apis'
+ ),
+ 'version' => 'eec01499761de7c20440'
),
'theme.js' => array(
'dependencies' => array(
@@ -817,7 +839,7 @@
'wp-element',
'wp-private-apis'
),
- 'version' => 'e22ce547a4420507b323'
+ 'version' => '1d6cd90c6ecb55fdb3c1'
),
'token-list.js' => array(
'dependencies' => array(
@@ -848,21 +870,21 @@
'import' => 'dynamic'
)
),
- 'version' => 'd359c2cccf866d7082d2'
+ 'version' => 'c3362866e191c81cdc90'
),
'url.js' => array(
'dependencies' => array(
),
- 'version' => 'bb0f766c3d2efe497871'
+ 'version' => '9dd5f16a5ce37bf4ba2c'
),
'viewport.js' => array(
'dependencies' => array(
- 'react-jsx-runtime',
'wp-compose',
- 'wp-data'
+ 'wp-data',
+ 'wp-element'
),
- 'version' => '8614025b8075d220d78f'
+ 'version' => '83b39beb77dcc56c4d26'
),
'warning.js' => array(
'dependencies' => array(
@@ -885,7 +907,7 @@
'wp-notices',
'wp-primitives'
),
- 'version' => '02b8dd683bc610f979fa'
+ 'version' => '3ab93e442c755a6b2b4e'
),
'wordcount.js' => array(
'dependencies' => array(
diff --git a/src/wp-includes/assets/script-modules-packages.php b/src/wp-includes/assets/script-modules-packages.php
index 30b248da04fc1..2a666f6d1b4e5 100644
--- a/src/wp-includes/assets/script-modules-packages.php
+++ b/src/wp-includes/assets/script-modules-packages.php
@@ -34,7 +34,7 @@
'import' => 'static'
)
),
- 'version' => '2af01b43d30739c3fb8d'
+ 'version' => 'f77b871ece5a791f449e'
),
'block-library/file/view.js' => array(
'dependencies' => array(
@@ -46,7 +46,7 @@
'import' => 'static'
)
),
- 'version' => '7d4d261d10dca47ebecb'
+ 'version' => 'a9114a756e418400594c'
),
'block-library/form/view.js' => array(
'dependencies' => array(
@@ -88,7 +88,7 @@
'import' => 'static'
)
),
- 'version' => '99f747d731f80246db11'
+ 'version' => '3440d5367efaa2741a5b'
),
'block-library/query/view.js' => array(
'dependencies' => array(
@@ -128,7 +128,7 @@
'import' => 'static'
)
),
- 'version' => '1f60dd5e3fa56c6b2e2e'
+ 'version' => '5d52d03cfb0ddbaca920'
),
'boot/index.js' => array(
'dependencies' => array(
@@ -166,7 +166,7 @@
'import' => 'static'
)
),
- 'version' => '54bb5a420026a61c7e4f'
+ 'version' => '72fd3d0a23e52ff8501f'
),
'connectors/index.js' => array(
'dependencies' => array(
@@ -177,7 +177,42 @@
'wp-i18n',
'wp-private-apis'
),
- 'version' => '274797868955a828dfdc'
+ 'version' => '753a649aa400199df0fd'
+ ),
+ 'content-types/index.js' => array(
+ 'dependencies' => array(
+ 'react',
+ 'react-dom',
+ 'react-jsx-runtime',
+ 'wp-components',
+ 'wp-compose',
+ 'wp-core-data',
+ 'wp-data',
+ 'wp-date',
+ 'wp-deprecated',
+ 'wp-element',
+ 'wp-i18n',
+ 'wp-is-shallow-equal',
+ 'wp-keycodes',
+ 'wp-notices',
+ 'wp-preferences',
+ 'wp-primitives',
+ 'wp-private-apis',
+ 'wp-theme',
+ 'wp-url',
+ 'wp-warning'
+ ),
+ 'module_dependencies' => array(
+ array(
+ 'id' => '@wordpress/a11y',
+ 'import' => 'static'
+ ),
+ array(
+ 'id' => '@wordpress/route',
+ 'import' => 'static'
+ )
+ ),
+ 'version' => 'b73e2c8d19862319099e'
),
'core-abilities/index.js' => array(
'dependencies' => array(
@@ -190,7 +225,7 @@
'import' => 'static'
)
),
- 'version' => '012760fd849397dd0031'
+ 'version' => 'ed8d088084da397754c1'
),
'edit-site-init/index.js' => array(
'dependencies' => array(
@@ -205,7 +240,7 @@
'import' => 'static'
)
),
- 'version' => 'e57f44d1a9f69e75d2d9'
+ 'version' => '03b5e26742d2806990c6'
),
'interactivity/index.js' => array(
'dependencies' => array(
@@ -273,7 +308,7 @@
'wp-private-apis',
'wp-style-engine'
),
- 'version' => '30ab62f45bfe9f971ea0'
+ 'version' => 'e9a1d3da960d762c5954'
),
'route/index.js' => array(
'dependencies' => array(
@@ -282,7 +317,7 @@
'react-jsx-runtime',
'wp-private-apis'
),
- 'version' => 'c5843b6c5e84b352f43b'
+ 'version' => '48a77bfa70722b4254e4'
),
'vips/loader.js' => array(
'dependencies' => array(
@@ -300,7 +335,7 @@
'dependencies' => array(
),
- 'version' => 'aff5e5c5b28ae6b73aaa'
+ 'version' => '4972ce7ba840491f17bb'
),
'workflow/index.js' => array(
'dependencies' => array(
@@ -319,8 +354,12 @@
array(
'id' => '@wordpress/abilities',
'import' => 'static'
+ ),
+ array(
+ 'id' => '@wordpress/core-abilities',
+ 'import' => 'static'
)
),
- 'version' => '13556bc597bbf2a8d620'
+ 'version' => 'c5983b82ce036952b349'
)
);
\ No newline at end of file
diff --git a/src/wp-includes/blocks/accordion-item.php b/src/wp-includes/blocks/accordion-item.php
index a16a1426e346d..8530b34de12d8 100644
--- a/src/wp-includes/blocks/accordion-item.php
+++ b/src/wp-includes/blocks/accordion-item.php
@@ -39,7 +39,6 @@ function block_core_accordion_item_render( array $attributes, string $content ):
if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-heading__toggle' ) ) ) {
$p->set_attribute( 'data-wp-on--click', 'actions.toggle' );
- $p->set_attribute( 'data-wp-on--keydown', 'actions.handleKeyDown' );
$p->set_attribute( 'id', $unique_id );
$p->set_attribute( 'aria-controls', $unique_id . '-panel' );
$p->set_attribute( 'data-wp-bind--aria-expanded', 'state.isOpen' );
diff --git a/src/wp-includes/blocks/accordion-item/block.json b/src/wp-includes/blocks/accordion-item/block.json
index 74bfddde0e68b..22987b9558a5f 100644
--- a/src/wp-includes/blocks/accordion-item/block.json
+++ b/src/wp-includes/blocks/accordion-item/block.json
@@ -16,6 +16,7 @@
"interactivity": true,
"spacing": {
"margin": [ "top", "bottom" ],
+ "padding": true,
"blockGap": true
},
"__experimentalBorder": {
diff --git a/src/wp-includes/blocks/blocks-json.php b/src/wp-includes/blocks/blocks-json.php
index e905b113502ac..b1ab52482add7 100644
--- a/src/wp-includes/blocks/blocks-json.php
+++ b/src/wp-includes/blocks/blocks-json.php
@@ -224,6 +224,7 @@
'top',
'bottom'
),
+ 'padding' => true,
'blockGap' => true
),
'__experimentalBorder' => array(
@@ -759,9 +760,6 @@
),
'gradient' => array(
'type' => 'string'
- ),
- 'width' => array(
- 'type' => 'number'
)
),
'supports' => array(
@@ -777,6 +775,15 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'width' => true,
+ '__experimentalSkipSerialization' => array(
+ 'width'
+ ),
+ '__experimentalDefaultControls' => array(
+ 'width' => true
+ )
+ ),
'typography' => array(
'__experimentalSkipSerialization' => array(
'fontSize',
@@ -851,6 +858,10 @@
'root' => '.wp-block-button .wp-block-button__link',
'typography' => array(
'writingMode' => '.wp-block-button'
+ ),
+ 'dimensions' => array(
+ 'root' => '.wp-block-button',
+ 'width' => '.wp-block-button'
)
)
),
@@ -2865,8 +2876,10 @@
'background' => array(
'backgroundImage' => true,
'backgroundSize' => true,
+ 'gradient' => true,
'__experimentalDefaultControls' => array(
- 'backgroundImage' => true
+ 'backgroundImage' => true,
+ 'gradient' => true
)
),
'color' => array(
@@ -2893,7 +2906,8 @@
)
),
'dimensions' => array(
- 'minHeight' => true
+ 'minHeight' => true,
+ 'minWidth' => true
),
'__experimentalBorder' => array(
'color' => true,
@@ -3034,6 +3048,13 @@
'label' => array(
'type' => 'string',
'role' => 'content'
+ ),
+ 'opensInNewTab' => array(
+ 'type' => 'boolean',
+ 'default' => false
+ ),
+ 'description' => array(
+ 'type' => 'string'
)
),
'usesContext' => array(
@@ -3115,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(
@@ -3291,6 +3324,10 @@
'source' => 'attribute',
'selector' => 'figure > a',
'attribute' => 'target'
+ ),
+ 'isDecorative' => array(
+ 'type' => 'boolean',
+ 'default' => false
)
),
'supports' => array(
@@ -3329,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(
@@ -3711,6 +3749,7 @@
),
'supports' => array(
'anchor' => true,
+ 'html' => false,
'className' => false,
'splitting' => true,
'__experimentalBorder' => array(
@@ -4378,6 +4417,11 @@
'clientNavigation' => true
)
),
+ 'selectors' => array(
+ 'states' => array(
+ '@current' => '.wp-block-navigation .current-menu-item'
+ )
+ ),
'editorStyle' => 'wp-block-navigation-link-editor',
'style' => 'wp-block-navigation-link'
),
@@ -4483,8 +4527,15 @@
),
'isTopLevelItem' => array(
'type' => 'boolean'
+ ),
+ 'isParentSubmenu' => array(
+ 'type' => 'boolean',
+ 'default' => true
)
),
+ 'providesContext' => array(
+ 'core/isInsideSubmenu' => 'isParentSubmenu'
+ ),
'usesContext' => array(
'textColor',
'customTextColor',
@@ -4572,10 +4623,6 @@
'parentPageID' => array(
'type' => 'integer',
'default' => 0
- ),
- 'isNested' => array(
- 'type' => 'boolean',
- 'default' => false
)
),
'usesContext' => array(
@@ -4592,7 +4639,8 @@
'showSubmenuIcon',
'style',
'openSubmenusOnClick',
- 'submenuVisibility'
+ 'submenuVisibility',
+ 'core/isInsideSubmenu'
),
'supports' => array(
'anchor' => true,
@@ -5348,9 +5396,6 @@
'type' => 'string',
'role' => 'content'
),
- 'textAlign' => array(
- 'type' => 'string'
- ),
'format' => array(
'type' => 'string'
),
@@ -5387,6 +5432,7 @@
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
+ 'textAlign' => true,
'__experimentalFontFamily' => true,
'__experimentalFontWeight' => true,
'__experimentalFontStyle' => true,
@@ -5423,9 +5469,6 @@
'description' => 'Display the excerpt.',
'textdomain' => 'default',
'attributes' => array(
- 'textAlign' => array(
- 'type' => 'string'
- ),
'moreText' => array(
'type' => 'string',
'role' => 'content'
@@ -5466,6 +5509,7 @@
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
+ 'textAlign' => true,
'textColumns' => true,
'__experimentalFontFamily' => true,
'__experimentalFontWeight' => true,
@@ -5606,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(
@@ -5624,9 +5669,6 @@
'description' => 'Displays the next or previous post link that is adjacent to the current post.',
'textdomain' => 'default',
'attributes' => array(
- 'textAlign' => array(
- 'type' => 'string'
- ),
'type' => array(
'type' => 'string',
'default' => 'next'
@@ -5665,6 +5707,7 @@
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
+ 'textAlign' => true,
'__experimentalFontFamily' => true,
'__experimentalFontWeight' => true,
'__experimentalFontStyle' => true,
@@ -5922,9 +5965,6 @@
'queryId'
),
'attributes' => array(
- 'textAlign' => array(
- 'type' => 'string'
- ),
'level' => array(
'type' => 'number',
'default' => 2
@@ -5947,6 +5987,9 @@
'type' => 'string',
'default' => '_self',
'role' => 'content'
+ ),
+ 'placeholder' => array(
+ 'type' => 'string'
)
),
'example' => array(
@@ -5975,6 +6018,7 @@
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
+ 'textAlign' => true,
'__experimentalFontFamily' => true,
'__experimentalFontWeight' => true,
'__experimentalFontStyle' => true,
@@ -6114,10 +6158,7 @@
)
),
'dimensions' => array(
- 'minHeight' => true,
- '__experimentalDefaultControls' => array(
- 'minHeight' => false
- )
+ 'minHeight' => true
),
'spacing' => array(
'margin' => true,
@@ -6523,9 +6564,6 @@
'type' => array(
'type' => 'string'
),
- 'textAlign' => array(
- 'type' => 'string'
- ),
'level' => array(
'type' => 'number',
'default' => 1
@@ -6571,6 +6609,7 @@
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
+ 'textAlign' => true,
'__experimentalFontFamily' => true,
'__experimentalFontStyle' => true,
'__experimentalFontWeight' => true,
@@ -6984,10 +7023,6 @@
'default' => array(
)
- ),
- 'isSearchFieldHidden' => array(
- 'type' => 'boolean',
- 'default' => false
)
),
'supports' => array(
@@ -7038,7 +7073,11 @@
'html' => false
),
'editorStyle' => 'wp-block-search-editor',
- 'style' => 'wp-block-search'
+ 'style' => 'wp-block-search',
+ 'selectors' => array(
+ 'color' => '.wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input',
+ 'border' => '.wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper'
+ )
),
'separator' => array(
'$schema' => 'https://schemas.wp.org/trunk/block.json',
@@ -7224,9 +7263,6 @@
),
'textdomain' => 'default',
'attributes' => array(
- 'textAlign' => array(
- 'type' => 'string'
- ),
'level' => array(
'type' => 'number',
'default' => 0
@@ -7247,7 +7283,11 @@
'example' => array(
'viewportWidth' => 350,
'attributes' => array(
- 'textAlign' => 'center'
+ 'style' => array(
+ 'typography' => array(
+ 'textAlign' => 'center'
+ )
+ )
)
),
'supports' => array(
@@ -7276,6 +7316,7 @@
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
+ 'textAlign' => true,
'__experimentalFontFamily' => true,
'__experimentalTextTransform' => true,
'__experimentalTextDecoration' => true,
@@ -7325,9 +7366,6 @@
6
)
),
- 'textAlign' => array(
- 'type' => 'string'
- ),
'isLink' => array(
'type' => 'boolean',
'default' => true,
@@ -7369,6 +7407,7 @@
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
+ 'textAlign' => true,
'__experimentalFontFamily' => true,
'__experimentalTextTransform' => true,
'__experimentalTextDecoration' => true,
diff --git a/src/wp-includes/blocks/button.php b/src/wp-includes/blocks/button.php
index 0d03440b1cb0f..8a7b43a2df315 100644
--- a/src/wp-includes/blocks/button.php
+++ b/src/wp-includes/blocks/button.php
@@ -60,6 +60,74 @@ function render_block_core_button( $attributes, $content ) {
return '';
}
+ $width = $attributes['style']['dimensions']['width'] ?? null;
+
+ if ( $width ) {
+ // Resolve preset references to their actual values.
+ $resolved_width = $width;
+ $is_preset = str_starts_with( $width, 'var:preset|dimension|' );
+
+ if ( $is_preset ) {
+ $slug = substr( $width, strlen( 'var:preset|dimension|' ) );
+ $dimension_presets = wp_get_global_settings(
+ array( 'dimensions', 'dimensionSizes' ),
+ array( 'block_name' => 'core/button' )
+ );
+
+ // Search origins in priority order: custom > theme > default.
+ if ( is_array( $dimension_presets ) ) {
+ foreach ( array( 'custom', 'theme', 'default' ) as $origin ) {
+ if ( empty( $dimension_presets[ $origin ] ) || ! is_array( $dimension_presets[ $origin ] ) ) {
+ continue;
+ }
+ foreach ( $dimension_presets[ $origin ] as $preset ) {
+ if ( isset( $preset['slug'] ) && $preset['slug'] === $slug ) {
+ $resolved_width = $preset['size'] ?? $width;
+ break 2;
+ }
+ }
+ }
+ }
+ }
+
+ $is_percentage = str_ends_with( $resolved_width, '%' );
+
+ $processor = new WP_HTML_Tag_Processor( $content );
+ // Target the outer wrapper div.
+ if ( $processor->next_tag( array( 'class_name' => 'wp-block-button' ) ) ) {
+ $processor->add_class( 'has-custom-width' );
+ $existing_style = $processor->get_attribute( 'style' );
+ $existing_style = is_string( $existing_style ) ? $existing_style : '';
+
+ if ( $is_percentage ) {
+ $numeric_width = (float) $resolved_width;
+ $processor->add_class( 'wp-block-button__width' );
+
+ // Maintain legacy class for the standard percentage widths.
+ $legacy_widths = array(
+ '25%' => 'wp-block-button__width-25',
+ '50%' => 'wp-block-button__width-50',
+ '75%' => 'wp-block-button__width-75',
+ '100%' => 'wp-block-button__width-100',
+ );
+ if ( isset( $legacy_widths[ $resolved_width ] ) ) {
+ $processor->add_class( $legacy_widths[ $resolved_width ] );
+ }
+
+ $width_style = "--wp--block-button--width: $numeric_width;";
+ $processor->set_attribute( 'style', $width_style . ( $existing_style ? ' ' . $existing_style : '' ) );
+ } else {
+ $css_value = $is_preset
+ ? 'var(--wp--preset--dimension--' . _wp_to_kebab_case( $slug ) . ')'
+ : $width;
+ $width_style = "width: $css_value;";
+ $processor->set_attribute( 'style', $width_style . ( $existing_style ? ' ' . $existing_style : '' ) );
+ }
+
+ $content = $processor->get_updated_html();
+ }
+ }
+
return $content;
}
diff --git a/src/wp-includes/blocks/button/block.json b/src/wp-includes/blocks/button/block.json
index 50ba4cda9c688..2e23a64c8f559 100644
--- a/src/wp-includes/blocks/button/block.json
+++ b/src/wp-includes/blocks/button/block.json
@@ -63,9 +63,6 @@
},
"gradient": {
"type": "string"
- },
- "width": {
- "type": "number"
}
},
"supports": {
@@ -81,6 +78,13 @@
"text": true
}
},
+ "dimensions": {
+ "width": true,
+ "__experimentalSkipSerialization": [ "width" ],
+ "__experimentalDefaultControls": {
+ "width": true
+ }
+ },
"typography": {
"__experimentalSkipSerialization": [
"fontSize",
@@ -145,6 +149,10 @@
"root": ".wp-block-button .wp-block-button__link",
"typography": {
"writingMode": ".wp-block-button"
+ },
+ "dimensions": {
+ "root": ".wp-block-button",
+ "width": ".wp-block-button"
}
}
}
diff --git a/src/wp-includes/blocks/cover.php b/src/wp-includes/blocks/cover.php
index 8da5db23ddc3f..16533acacd764 100644
--- a/src/wp-includes/blocks/cover.php
+++ b/src/wp-includes/blocks/cover.php
@@ -39,13 +39,13 @@ function render_block_core_cover( $attributes, $content ) {
$lower_src = strtolower( $iframe_src );
$provider = null;
- if ( strpos( $lower_src, 'youtube.com' ) !== false || strpos( $lower_src, 'youtu.be' ) !== false ) {
+ if ( str_contains( $lower_src, 'youtube.com' ) || str_contains( $lower_src, 'youtu.be' ) ) {
$provider = 'youtube';
- } elseif ( strpos( $lower_src, 'vimeo.com' ) !== false ) {
+ } elseif ( str_contains( $lower_src, 'vimeo.com' ) ) {
$provider = 'vimeo';
- } elseif ( strpos( $lower_src, 'videopress.com' ) !== false ) {
+ } elseif ( str_contains( $lower_src, 'videopress.com' ) ) {
$provider = 'videopress';
- } elseif ( strpos( $lower_src, 'wordpress.tv' ) !== false ) {
+ } elseif ( str_contains( $lower_src, 'wordpress.tv' ) ) {
$provider = 'wordpress-tv';
}
diff --git a/src/wp-includes/blocks/group/block.json b/src/wp-includes/blocks/group/block.json
index e83fb60d31fc7..7fa2ad2ccf4c7 100644
--- a/src/wp-includes/blocks/group/block.json
+++ b/src/wp-includes/blocks/group/block.json
@@ -28,8 +28,10 @@
"background": {
"backgroundImage": true,
"backgroundSize": true,
+ "gradient": true,
"__experimentalDefaultControls": {
- "backgroundImage": true
+ "backgroundImage": true,
+ "gradient": true
}
},
"color": {
@@ -53,7 +55,8 @@
}
},
"dimensions": {
- "minHeight": true
+ "minHeight": true,
+ "minWidth": true
},
"__experimentalBorder": {
"color": true,
diff --git a/src/wp-includes/blocks/home-link.php b/src/wp-includes/blocks/home-link.php
index d61aa0bc235e2..48c4b5b191807 100644
--- a/src/wp-includes/blocks/home-link.php
+++ b/src/wp-includes/blocks/home-link.php
@@ -59,36 +59,6 @@ function block_core_home_link_build_css_colors( $context ) {
return $colors;
}
-/**
- * Build an array with CSS classes and inline styles defining the font sizes
- * which will be applied to the home link markup in the front-end.
- *
- * @since 6.0.0
- *
- * @param array $context Home link block context.
- * @return array Font size CSS classes and inline styles.
- */
-function block_core_home_link_build_css_font_sizes( $context ) {
- // CSS classes.
- $font_sizes = array(
- 'css_classes' => array(),
- 'inline_styles' => '',
- );
-
- $has_named_font_size = array_key_exists( 'fontSize', $context );
- $has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
-
- if ( $has_named_font_size ) {
- // Add the font size class.
- $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
- } elseif ( $has_custom_font_size ) {
- // Add the custom font size inline style.
- $font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] );
- }
-
- return $font_sizes;
-}
-
/**
* Builds an array with classes and style for the li wrapper
*
@@ -98,13 +68,12 @@ function block_core_home_link_build_css_font_sizes( $context ) {
* @return string The li wrapper attributes.
*/
function block_core_home_link_build_li_wrapper_attributes( $context ) {
- $colors = block_core_home_link_build_css_colors( $context );
- $font_sizes = block_core_home_link_build_css_font_sizes( $context );
- $classes = array_merge(
- $colors['css_classes'],
- $font_sizes['css_classes']
+ $colors = block_core_home_link_build_css_colors( $context );
+ $classes = array_merge(
+ $colors['css_classes']
);
- $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] );
+
+ $style_attribute = ( $colors['inline_styles'] );
$classes[] = 'wp-block-navigation-item';
if ( is_front_page() ) {
@@ -148,12 +117,24 @@ function render_block_core_home_link( $attributes, $content, $block ) {
$aria_current = ' aria-current="page"';
}
+ $target = '';
+ if ( isset( $attributes['opensInNewTab'] ) && true === $attributes['opensInNewTab'] ) {
+ $target = ' target="_blank"';
+ }
+
+ $description = '';
+ if ( ! empty( $attributes['description'] ) ) {
+ $description = '' . wp_kses_post( $attributes['description'] ) . '';
+ }
+
return sprintf(
- '
%4$s',
+ '%5$s%6$s',
block_core_home_link_build_li_wrapper_attributes( $block->context ),
esc_url( home_url() ),
+ $target,
$aria_current,
- wp_kses_post( $attributes['label'] )
+ wp_kses_post( $attributes['label'] ),
+ $description
);
}
diff --git a/src/wp-includes/blocks/home-link/block.json b/src/wp-includes/blocks/home-link/block.json
index 42652ba9b72ca..a2efb056469cd 100644
--- a/src/wp-includes/blocks/home-link/block.json
+++ b/src/wp-includes/blocks/home-link/block.json
@@ -11,6 +11,13 @@
"label": {
"type": "string",
"role": "content"
+ },
+ "opensInNewTab": {
+ "type": "boolean",
+ "default": false
+ },
+ "description": {
+ "type": "string"
}
},
"usesContext": [
diff --git a/src/wp-includes/blocks/icon.php b/src/wp-includes/blocks/icon.php
index e09319cffea3b..205cd397d7c42 100644
--- a/src/wp-includes/blocks/icon.php
+++ b/src/wp-includes/blocks/icon.php
@@ -10,9 +10,7 @@
*
* @since 7.0.0
*
- * @param array $attributes The block attributes.
- * @param string $content The block content.
- * @param WP_Block $block The block instance.
+ * @param array $attributes The block attributes.
*
* @return string Returns the Icon.
*/
@@ -98,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 22b0ecc2aea33..5aa42bb48ab98 100644
--- a/src/wp-includes/blocks/image.php
+++ b/src/wp-includes/blocks/image.php
@@ -171,13 +171,13 @@ function block_core_image_get_lightbox_settings( $block ) {
*
* @since 6.4.0
*
- * @param string $block_content Rendered block content.
- * @param array $block Block object.
- * @param array $block_instance Block instance.
+ * @param string $block_content Rendered block content.
+ * @param array $block Block object.
+ * @param WP_Block $block_instance Block instance.
*
* @return string Filtered block content.
*/
-function block_core_image_render_lightbox( $block_content, $block, $block_instance ) {
+function block_core_image_render_lightbox( $block_content, array $block, WP_Block $block_instance ) {
/*
* If there's no IMG tag in the block then return the given block content
* as-is. There's nothing that this code can knowingly modify to add the
@@ -250,7 +250,7 @@ function block_core_image_render_lightbox( $block_content, $block, $block_instan
'galleryId' => $block_instance->context['galleryId'] ?? null,
'customAriaLabel' => $custom_aria_label ?? null,
'navigationButtonType' => $block_instance->context['navigationButtonType'] ?? 'icon',
- 'triggerButtonAriaLabel' => null,
+ 'triggerButtonAriaLabel' => __( 'Enlarge' ),
),
),
)
diff --git a/src/wp-includes/blocks/image/block.json b/src/wp-includes/blocks/image/block.json
index 66a4fac4a3023..a8879d4258480 100644
--- a/src/wp-includes/blocks/image/block.json
+++ b/src/wp-includes/blocks/image/block.json
@@ -105,6 +105,10 @@
"source": "attribute",
"selector": "figure > a",
"attribute": "target"
+ },
+ "isDecorative": {
+ "type": "boolean",
+ "default": false
}
},
"supports": {
@@ -137,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/latest-posts.php b/src/wp-includes/blocks/latest-posts.php
index 44231ac6d14a1..c829852f8cfde 100644
--- a/src/wp-includes/blocks/latest-posts.php
+++ b/src/wp-includes/blocks/latest-posts.php
@@ -163,7 +163,7 @@ function render_block_core_latest_posts( $attributes ) {
$trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 );
$trimmed_excerpt .= sprintf(
/* translators: 1: A URL to a post, 2: Hidden accessibility text: Post title */
- __( '… Read more: %2$s' ),
+ __( '… Read more: %2$s' ),
esc_url( $post_link ),
esc_html( $title )
);
diff --git a/src/wp-includes/blocks/list-item/block.json b/src/wp-includes/blocks/list-item/block.json
index 1cdba86f19b2e..cdefd6c232bf3 100644
--- a/src/wp-includes/blocks/list-item/block.json
+++ b/src/wp-includes/blocks/list-item/block.json
@@ -21,6 +21,7 @@
},
"supports": {
"anchor": true,
+ "html": false,
"className": false,
"splitting": true,
"__experimentalBorder": {
diff --git a/src/wp-includes/blocks/loginout.php b/src/wp-includes/blocks/loginout.php
index f83d8be424ece..a9e05f8630bfe 100644
--- a/src/wp-includes/blocks/loginout.php
+++ b/src/wp-includes/blocks/loginout.php
@@ -38,6 +38,19 @@ function render_block_core_loginout( $attributes ) {
// Get the form.
$contents = wp_login_form( array( 'echo' => false ) );
+
+ if ( wp_is_block_theme() ) {
+ $processor = new WP_HTML_Tag_Processor( $contents );
+
+ while ( $processor->next_tag( 'input' ) ) {
+ if ( 'submit' === $processor->get_attribute( 'type' ) && 'wp-submit' === $processor->get_attribute( 'name' ) ) {
+ $processor->add_class( 'wp-block-button__link' );
+ $processor->add_class( wp_theme_get_element_class_name( 'button' ) );
+ $contents = $processor->get_updated_html();
+ break;
+ }
+ }
+ }
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
diff --git a/src/wp-includes/blocks/navigation-link.php b/src/wp-includes/blocks/navigation-link.php
index 0888d7b5acebd..6a1cfb9918873 100644
--- a/src/wp-includes/blocks/navigation-link.php
+++ b/src/wp-includes/blocks/navigation-link.php
@@ -5,14 +5,8 @@
* @package WordPress
*/
-// Path differs between source and build: './shared/' in source, './navigation-link/shared/' in build.
-if ( file_exists( __DIR__ . '/shared/item-should-render.php' ) ) {
- require_once __DIR__ . '/shared/item-should-render.php';
- require_once __DIR__ . '/shared/render-submenu-icon.php';
-} else {
- require_once __DIR__ . '/navigation-link/shared/item-should-render.php';
- require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php';
-}
+require_once __DIR__ . '/navigation-link/shared/item-should-render.php';
+require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php';
/**
* Build an array with CSS classes and inline styles defining the colors
@@ -86,43 +80,6 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is
return $colors;
}
-/**
- * Build an array with CSS classes and inline styles defining the font sizes
- * which will be applied to the navigation markup in the front-end.
- *
- * @since 5.9.0
- *
- * @param array $context Navigation block context.
- * @return array Font size CSS classes and inline styles.
- */
-function block_core_navigation_link_build_css_font_sizes( $context ) {
- // CSS classes.
- $font_sizes = array(
- 'css_classes' => array(),
- 'inline_styles' => '',
- );
-
- $has_named_font_size = array_key_exists( 'fontSize', $context );
- $has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
-
- if ( $has_named_font_size ) {
- // Add the font size class.
- $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
- } elseif ( $has_custom_font_size ) {
- // Add the custom font size inline style.
- $font_sizes['inline_styles'] = sprintf(
- 'font-size: %s;',
- wp_get_typography_font_size_value(
- array(
- 'size' => $context['style']['typography']['fontSize'],
- )
- )
- );
- }
-
- return $font_sizes;
-}
-
/**
* Decodes a url if it's encoded, returning the same url if not.
*
@@ -180,11 +137,7 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
return '';
}
- $font_sizes = block_core_navigation_link_build_css_font_sizes( $block->context );
- $classes = array_merge(
- $font_sizes['css_classes']
- );
- $style_attribute = $font_sizes['inline_styles'];
+ $classes = array();
// Render inner blocks first to check if any menu items will actually display.
$inner_blocks_html = '';
@@ -208,7 +161,6 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
array(
'class' => $css_classes . ' wp-block-navigation-item' . ( $has_submenu ? ' has-child' : '' ) .
( $is_active ? ' current-menu-item' : '' ),
- 'style' => $style_attribute,
)
);
$html = '' .
@@ -262,7 +214,13 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
if ( isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'] && $has_submenu ) {
// The submenu icon can be hidden by a CSS rule on the Navigation Block.
- $html .= '';
+ $html .= '';
}
if ( $has_submenu ) {
@@ -485,4 +443,4 @@ function register_block_core_navigation_link() {
* Creates all variations for post types / taxonomies dynamically (= each time when variations are requested).
* Do not use variation_callback, to also account for unregistering post types/taxonomies later on.
*/
-add_action( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 );
+add_filter( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 );
diff --git a/src/wp-includes/blocks/navigation-link/block.json b/src/wp-includes/blocks/navigation-link/block.json
index 997275574f1ac..0735461d0b29a 100644
--- a/src/wp-includes/blocks/navigation-link/block.json
+++ b/src/wp-includes/blocks/navigation-link/block.json
@@ -85,6 +85,11 @@
"clientNavigation": true
}
},
+ "selectors": {
+ "states": {
+ "@current": ".wp-block-navigation .current-menu-item"
+ }
+ },
"editorStyle": "wp-block-navigation-link-editor",
"style": "wp-block-navigation-link"
}
diff --git a/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php b/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php
new file mode 100644
index 0000000000000..38fd82d12dac8
--- /dev/null
+++ b/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php
@@ -0,0 +1,43 @@
+ array(),
+ 'inline_styles' => '',
+ );
+
+ $has_named_font_size = array_key_exists( 'fontSize', $context );
+ $has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
+
+ if ( $has_named_font_size ) {
+ // Add the font size class.
+ $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
+ } elseif ( $has_custom_font_size ) {
+ // Add the custom font size inline style.
+ $font_sizes['inline_styles'] = sprintf(
+ 'font-size: %s;',
+ wp_get_typography_font_size_value(
+ array(
+ 'size' => $context['style']['typography']['fontSize'],
+ )
+ )
+ );
+ }
+
+ return $font_sizes;
+}
diff --git a/src/wp-includes/blocks/navigation-submenu.php b/src/wp-includes/blocks/navigation-submenu.php
index 9138b5a5e08da..831c7d1807dfb 100644
--- a/src/wp-includes/blocks/navigation-submenu.php
+++ b/src/wp-includes/blocks/navigation-submenu.php
@@ -5,6 +5,22 @@
* @package WordPress
*/
+require_once __DIR__ . '/navigation-link/shared/item-should-render.php';
+require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php';
+
+/**
+ * Renders the submenu icon SVG for the Navigation Submenu block.
+ *
+ * @since 5.9.0
+ * @deprecated 7.0.0 Use block_core_shared_navigation_render_submenu_icon() instead.
+ *
+ * @return string SVG markup for the submenu icon.
+ */
+function block_core_navigation_submenu_render_submenu_icon() {
+ _deprecated_function( __FUNCTION__, '7.0.0', 'block_core_shared_navigation_render_submenu_icon()' );
+ return block_core_shared_navigation_render_submenu_icon();
+}
+
/**
* Returns the submenu visibility value with backward compatibility
* for the deprecated openSubmenusOnClick attribute.
@@ -46,52 +62,6 @@ function block_core_navigation_submenu_get_submenu_visibility( $context ) {
return $submenu_visibility ?? 'hover';
}
-// Path differs between source and build: '../navigation-link/shared/' in source, './navigation-link/shared/' in build.
-if ( file_exists( __DIR__ . '/../navigation-link/shared/item-should-render.php' ) ) {
- require_once __DIR__ . '/../navigation-link/shared/item-should-render.php';
- require_once __DIR__ . '/../navigation-link/shared/render-submenu-icon.php';
-} else {
- require_once __DIR__ . '/navigation-link/shared/item-should-render.php';
- require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php';
-}
-
-/**
- * Build an array with CSS classes and inline styles defining the font sizes
- * which will be applied to the navigation markup in the front-end.
- *
- * @since 5.9.0
- *
- * @param array $context Navigation block context.
- * @return array Font size CSS classes and inline styles.
- */
-function block_core_navigation_submenu_build_css_font_sizes( $context ) {
- // CSS classes.
- $font_sizes = array(
- 'css_classes' => array(),
- 'inline_styles' => '',
- );
-
- $has_named_font_size = array_key_exists( 'fontSize', $context );
- $has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
-
- if ( $has_named_font_size ) {
- // Add the font size class.
- $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
- } elseif ( $has_custom_font_size ) {
- // Add the custom font size inline style.
- $font_sizes['inline_styles'] = sprintf(
- 'font-size: %s;',
- wp_get_typography_font_size_value(
- array(
- 'size' => $context['style']['typography']['fontSize'],
- )
- )
- );
- }
-
- return $font_sizes;
-}
-
/**
* Renders the `core/navigation-submenu` block.
*
@@ -116,9 +86,6 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
return '';
}
- $font_sizes = block_core_navigation_submenu_build_css_font_sizes( $block->context );
- $style_attribute = $font_sizes['inline_styles'];
-
// Render inner blocks first to check if any menu items will actually display.
$inner_blocks_html = '';
foreach ( $block->inner_blocks as $inner_block ) {
@@ -145,10 +112,7 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
$classes = array(
'wp-block-navigation-item',
);
- $classes = array_merge(
- $classes,
- $font_sizes['css_classes']
- );
+
if ( $has_submenu ) {
$classes[] = 'has-child';
}
@@ -168,7 +132,6 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
$wrapper_attributes = get_block_wrapper_attributes(
array(
'class' => implode( ' ', $classes ),
- 'style' => $style_attribute,
)
);
@@ -240,7 +203,13 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
if ( $show_submenu_indicators && $has_submenu ) {
// The submenu icon is rendered in a button here
// so that there's a clickable element to open the submenu.
- $html .= '';
+ $html .= '';
}
} else {
$html .= '';
if ( $has_submenu ) {
- $html .= '';
+ $html .= '';
}
}
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 71e8d85b035dc..eb960636b9f25 100644
--- a/src/wp-includes/blocks/navigation.php
+++ b/src/wp-includes/blocks/navigation.php
@@ -1354,17 +1354,6 @@ function block_core_navigation_build_css_font_sizes( $attributes ) {
return $font_sizes;
}
-/**
- * Returns the top-level submenu SVG chevron icon.
- *
- * @since 5.9.0
- *
- * @return string
- */
-function block_core_navigation_render_submenu_icon() {
- return '';
-}
-
/**
* Filter out empty "null" blocks from the block list.
* 'parse_blocks' includes a null block with '\n\n' as the content when
@@ -1568,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 27e63f250a811..6dd368f8c8d43 100644
--- a/src/wp-includes/blocks/page-list.php
+++ b/src/wp-includes/blocks/page-list.php
@@ -123,50 +123,12 @@ function block_core_page_list_build_css_colors( $attributes, $context ) {
return $colors;
}
-
-/**
- * Build an array with CSS classes and inline styles defining the font sizes
- * which will be applied to the pages markup in the front-end when it is a descendant of navigation.
- *
- * @since 5.8.0
- *
- * @param array $context Navigation block context.
- * @return array Font size CSS classes and inline styles.
- */
-function block_core_page_list_build_css_font_sizes( $context ) {
- // CSS classes.
- $font_sizes = array(
- 'css_classes' => array(),
- 'inline_styles' => '',
- );
-
- $has_named_font_size = array_key_exists( 'fontSize', $context );
- $has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
-
- if ( $has_named_font_size ) {
- // Add the font size class.
- $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
- } elseif ( $has_custom_font_size ) {
- // Add the custom font size inline style.
- $font_sizes['inline_styles'] = sprintf(
- 'font-size: %s;',
- wp_get_typography_font_size_value(
- array(
- 'size' => $context['style']['typography']['fontSize'],
- )
- )
- );
- }
-
- return $font_sizes;
-}
-
/**
* Outputs Page list markup from an array of pages with nested children.
*
* @since 5.8.0
*
- * @param boolean $open_submenus_on_click Whether to open submenus on click instead of hover.
+ * @param string $submenu_visibility The submenu visibility mode: 'hover', 'click', or 'always'.
* @param boolean $show_submenu_icons Whether to show submenu indicator icons.
* @param boolean $is_navigation_child If block is a child of Navigation block.
* @param array $nested_pages The array of nested pages.
@@ -297,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(
@@ -342,13 +304,12 @@ function render_block_core_page_list( $attributes, $content, $block ) {
}
}
- $colors = block_core_page_list_build_css_colors( $attributes, $block->context );
- $font_sizes = block_core_page_list_build_css_font_sizes( $block->context );
- $classes = array_merge(
- $colors['css_classes'],
- $font_sizes['css_classes']
+ $colors = block_core_page_list_build_css_colors( $attributes, $block->context );
+ $classes = array_merge(
+ $colors['css_classes']
);
- $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] );
+
+ $style_attribute = ( $colors['inline_styles'] );
$css_classes = trim( implode( ' ', $classes ) );
$nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children );
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-author-name.php b/src/wp-includes/blocks/post-author-name.php
index ac514401f5cc2..73113eb1efc4b 100644
--- a/src/wp-includes/blocks/post-author-name.php
+++ b/src/wp-includes/blocks/post-author-name.php
@@ -32,7 +32,7 @@ function render_block_core_post_author_name( $attributes, $content, $block ) {
$author_name = get_the_author_meta( 'display_name', $author_id );
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
- $author_name = sprintf( '%3$s', get_author_posts_url( $author_id ), esc_attr( $attributes['linkTarget'] ), $author_name );
+ $author_name = sprintf( '%3$s', esc_url( get_author_posts_url( $author_id ) ), esc_attr( $attributes['linkTarget'] ), $author_name );
}
$classes = array();
diff --git a/src/wp-includes/blocks/post-date.php b/src/wp-includes/blocks/post-date.php
index a8073dd846217..5c92c46aa60d4 100644
--- a/src/wp-includes/blocks/post-date.php
+++ b/src/wp-includes/blocks/post-date.php
@@ -84,7 +84,7 @@ function render_block_core_post_date( $attributes, $content, $block ) {
$time_tag = sprintf( '', $unformatted_date, $formatted_date );
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] && isset( $block->context['postId'] ) ) {
- $time_tag = sprintf( '%2s', get_the_permalink( $block->context['postId'] ), $time_tag );
+ $time_tag = sprintf( '%2$s', esc_url( get_the_permalink( $block->context['postId'] ) ), $time_tag );
}
return sprintf( '%2$s
', $wrapper_attributes, $time_tag );
diff --git a/src/wp-includes/blocks/post-date/block.json b/src/wp-includes/blocks/post-date/block.json
index 7952e36af3661..75eb1eda38d8f 100644
--- a/src/wp-includes/blocks/post-date/block.json
+++ b/src/wp-includes/blocks/post-date/block.json
@@ -11,9 +11,6 @@
"type": "string",
"role": "content"
},
- "textAlign": {
- "type": "string"
- },
"format": {
"type": "string"
},
@@ -46,6 +43,7 @@
"typography": {
"fontSize": true,
"lineHeight": true,
+ "textAlign": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
diff --git a/src/wp-includes/blocks/post-excerpt/block.json b/src/wp-includes/blocks/post-excerpt/block.json
index 99f6d5dcc99ed..17678a35c2950 100644
--- a/src/wp-includes/blocks/post-excerpt/block.json
+++ b/src/wp-includes/blocks/post-excerpt/block.json
@@ -7,9 +7,6 @@
"description": "Display the excerpt.",
"textdomain": "default",
"attributes": {
- "textAlign": {
- "type": "string"
- },
"moreText": {
"type": "string",
"role": "content"
@@ -46,6 +43,7 @@
"typography": {
"fontSize": true,
"lineHeight": true,
+ "textAlign": true,
"textColumns": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
diff --git a/src/wp-includes/blocks/post-featured-image.php b/src/wp-includes/blocks/post-featured-image.php
index e9fc60f7038f5..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',
- get_the_permalink( $post_ID ),
+ '%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}";
}
@@ -166,10 +168,8 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes
}
// Apply overlay and gradient classes.
- if ( $has_dim_background ) {
- $class_names[] = 'has-background-dim';
- $class_names[] = "has-background-dim-{$attributes['dimRatio']}";
- }
+ $class_names[] = 'has-background-dim';
+ $class_names[] = "has-background-dim-{$attributes['dimRatio']}";
if ( $has_solid_overlay ) {
$class_names[] = "has-{$attributes['overlayColor']}-background-color";
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/post-navigation-link/block.json b/src/wp-includes/blocks/post-navigation-link/block.json
index 6d51d619637c9..83cf63af7841b 100644
--- a/src/wp-includes/blocks/post-navigation-link/block.json
+++ b/src/wp-includes/blocks/post-navigation-link/block.json
@@ -7,9 +7,6 @@
"description": "Displays the next or previous post link that is adjacent to the current post.",
"textdomain": "default",
"attributes": {
- "textAlign": {
- "type": "string"
- },
"type": {
"type": "string",
"default": "next"
@@ -46,6 +43,7 @@
"typography": {
"fontSize": true,
"lineHeight": true,
+ "textAlign": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
diff --git a/src/wp-includes/blocks/post-template.php b/src/wp-includes/blocks/post-template.php
index 72ebbe0e13d13..9ce4ce47343e1 100644
--- a/src/wp-includes/blocks/post-template.php
+++ b/src/wp-includes/blocks/post-template.php
@@ -94,6 +94,9 @@ function render_block_core_post_template( $attributes, $content, $block ) {
if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) ) {
$classnames .= ' ' . sanitize_title( 'columns-' . $attributes['layout']['columnCount'] );
}
+ if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) && ! empty( $attributes['layout']['minimumColumnWidth'] ) ) {
+ $classnames .= ' has-native-responsive-grid';
+ }
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classnames ) ) );
diff --git a/src/wp-includes/blocks/post-title/block.json b/src/wp-includes/blocks/post-title/block.json
index 1fb7efcf82db5..d1ded484486bd 100644
--- a/src/wp-includes/blocks/post-title/block.json
+++ b/src/wp-includes/blocks/post-title/block.json
@@ -8,9 +8,6 @@
"textdomain": "default",
"usesContext": [ "postId", "postType", "queryId" ],
"attributes": {
- "textAlign": {
- "type": "string"
- },
"level": {
"type": "number",
"default": 2
@@ -33,6 +30,9 @@
"type": "string",
"default": "_self",
"role": "content"
+ },
+ "placeholder": {
+ "type": "string"
}
},
"example": {
@@ -58,6 +58,7 @@
"typography": {
"fontSize": true,
"lineHeight": true,
+ "textAlign": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
diff --git a/src/wp-includes/blocks/pullquote/block.json b/src/wp-includes/blocks/pullquote/block.json
index 271bba74d0252..9469f420d1db7 100644
--- a/src/wp-includes/blocks/pullquote/block.json
+++ b/src/wp-includes/blocks/pullquote/block.json
@@ -43,10 +43,7 @@
}
},
"dimensions": {
- "minHeight": true,
- "__experimentalDefaultControls": {
- "minHeight": false
- }
+ "minHeight": true
},
"spacing": {
"margin": true,
diff --git a/src/wp-includes/blocks/query-title.php b/src/wp-includes/blocks/query-title.php
index d26a3d08ae42a..845a4bdc05aa7 100644
--- a/src/wp-includes/blocks/query-title.php
+++ b/src/wp-includes/blocks/query-title.php
@@ -13,7 +13,7 @@
* @since 5.8.0
*
* @param array $attributes Block attributes.
- * @param array $_content Block content.
+ * @param array $content Block content.
* @param object $block Block instance.
*
* @return string Returns the query title based on the queried object.
diff --git a/src/wp-includes/blocks/query-title/block.json b/src/wp-includes/blocks/query-title/block.json
index 41e9e3fd29b62..786a46fe5cb1b 100644
--- a/src/wp-includes/blocks/query-title/block.json
+++ b/src/wp-includes/blocks/query-title/block.json
@@ -10,9 +10,6 @@
"type": {
"type": "string"
},
- "textAlign": {
- "type": "string"
- },
"level": {
"type": "number",
"default": 1
@@ -53,6 +50,7 @@
"typography": {
"fontSize": true,
"lineHeight": true,
+ "textAlign": true,
"__experimentalFontFamily": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
diff --git a/src/wp-includes/blocks/read-more.php b/src/wp-includes/blocks/read-more.php
index c01a0a377fc93..bf14f8ea242e8 100644
--- a/src/wp-includes/blocks/read-more.php
+++ b/src/wp-includes/blocks/read-more.php
@@ -38,9 +38,9 @@ function render_block_core_read_more( $attributes, $content, $block ) {
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $justify_class_name ) );
$more_text = ! empty( $attributes['content'] ) ? wp_kses_post( $attributes['content'] ) : __( 'Read more' );
return sprintf(
- '%4s%5s',
+ '%4$s%5$s',
$wrapper_attributes,
- get_the_permalink( $post_ID ),
+ esc_url( get_the_permalink( $post_ID ) ),
esc_attr( $attributes['linkTarget'] ),
$more_text,
$screen_reader_text
diff --git a/src/wp-includes/blocks/search.php b/src/wp-includes/blocks/search.php
index 7073d6ce8ab3f..07c051b8f6eb9 100644
--- a/src/wp-includes/blocks/search.php
+++ b/src/wp-includes/blocks/search.php
@@ -69,10 +69,13 @@ function render_block_core_search( $attributes ) {
if ( ! empty( $typography_classes ) ) {
$input_classes[] = $typography_classes;
}
+ if ( ! $show_button && ! empty( $color_classes ) ) {
+ $input_classes[] = $color_classes;
+ }
if ( $input->next_tag() ) {
$input->add_class( implode( ' ', $input_classes ) );
$input->set_attribute( 'id', $input_id );
- $input->set_attribute( 'value', get_search_query() );
+ $input->set_attribute( 'value', get_search_query( false ) );
$input->set_attribute( 'placeholder', $attributes['placeholder'] );
// If it's interactive, enqueue the script module and add the directives.
@@ -430,20 +433,37 @@ function styles_for_block_core_search( $attributes ) {
}
}
+ $use_input_for_colors = ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition'];
+
// Add color styles.
$has_text_color = ! empty( $attributes['style']['color']['text'] );
if ( $has_text_color ) {
- $button_styles[] = sprintf( 'color: %s;', $attributes['style']['color']['text'] );
+ $text_color_style = sprintf( 'color: %s;', $attributes['style']['color']['text'] );
+ if ( $use_input_for_colors ) {
+ $input_styles[] = $text_color_style;
+ } else {
+ $button_styles[] = $text_color_style;
+ }
}
$has_background_color = ! empty( $attributes['style']['color']['background'] );
if ( $has_background_color ) {
- $button_styles[] = sprintf( 'background-color: %s;', $attributes['style']['color']['background'] );
+ $background_color_style = sprintf( 'background-color: %s;', $attributes['style']['color']['background'] );
+ if ( $use_input_for_colors ) {
+ $input_styles[] = $background_color_style;
+ } else {
+ $button_styles[] = $background_color_style;
+ }
}
$has_custom_gradient = ! empty( $attributes['style']['color']['gradient'] );
if ( $has_custom_gradient ) {
- $button_styles[] = sprintf( 'background: %s;', $attributes['style']['color']['gradient'] );
+ $custom_gradient_style = sprintf( 'background: %s;', $attributes['style']['color']['gradient'] );
+ if ( $use_input_for_colors ) {
+ $input_styles[] = $custom_gradient_style;
+ } else {
+ $button_styles[] = $custom_gradient_style;
+ }
}
// Get typography styles to be shared across inner elements.
diff --git a/src/wp-includes/blocks/search/block.json b/src/wp-includes/blocks/search/block.json
index a6146d4404041..be9c0e3cdc2d5 100644
--- a/src/wp-includes/blocks/search/block.json
+++ b/src/wp-includes/blocks/search/block.json
@@ -42,10 +42,6 @@
"query": {
"type": "object",
"default": {}
- },
- "isSearchFieldHidden": {
- "type": "boolean",
- "default": false
}
},
"supports": {
@@ -92,5 +88,9 @@
"html": false
},
"editorStyle": "wp-block-search-editor",
- "style": "wp-block-search"
+ "style": "wp-block-search",
+ "selectors": {
+ "color": ".wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input",
+ "border": ".wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper"
+ }
}
diff --git a/src/wp-includes/blocks/site-tagline/block.json b/src/wp-includes/blocks/site-tagline/block.json
index 756b2dcb8183a..1b2764d0cfa9a 100644
--- a/src/wp-includes/blocks/site-tagline/block.json
+++ b/src/wp-includes/blocks/site-tagline/block.json
@@ -8,9 +8,6 @@
"keywords": [ "description" ],
"textdomain": "default",
"attributes": {
- "textAlign": {
- "type": "string"
- },
"level": {
"type": "number",
"default": 0
@@ -23,7 +20,11 @@
"example": {
"viewportWidth": 350,
"attributes": {
- "textAlign": "center"
+ "style": {
+ "typography": {
+ "textAlign": "center"
+ }
+ }
}
},
"supports": {
@@ -49,6 +50,7 @@
"typography": {
"fontSize": true,
"lineHeight": true,
+ "textAlign": true,
"__experimentalFontFamily": true,
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
diff --git a/src/wp-includes/blocks/site-title/block.json b/src/wp-includes/blocks/site-title/block.json
index ac6a3c10e086a..0631de6560ba4 100644
--- a/src/wp-includes/blocks/site-title/block.json
+++ b/src/wp-includes/blocks/site-title/block.json
@@ -15,9 +15,6 @@
"type": "array",
"default": [ 0, 1, 2, 3, 4, 5, 6 ]
},
- "textAlign": {
- "type": "string"
- },
"isLink": {
"type": "boolean",
"default": true,
@@ -56,6 +53,7 @@
"typography": {
"fontSize": true,
"lineHeight": true,
+ "textAlign": true,
"__experimentalFontFamily": true,
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
diff --git a/src/wp-includes/build/constants.php b/src/wp-includes/build/constants.php
index 37c81b5ccc21b..ad12ede4b12e2 100644
--- a/src/wp-includes/build/constants.php
+++ b/src/wp-includes/build/constants.php
@@ -9,6 +9,6 @@
*/
return array(
- 'version' => '22.6.0-rc.1',
+ 'version' => '23.4.0-rc.1',
'build_url' => includes_url( 'build/' ),
);
diff --git a/src/wp-includes/build/pages.php b/src/wp-includes/build/pages.php
index 14ca6a08fbbc1..4ba7d4921e0a0 100644
--- a/src/wp-includes/build/pages.php
+++ b/src/wp-includes/build/pages.php
@@ -6,7 +6,13 @@
* @package wp
*/
-require_once __DIR__ . '/pages/font-library/page.php';
-require_once __DIR__ . '/pages/font-library/page-wp-admin.php';
-require_once __DIR__ . '/pages/options-connectors/page.php';
-require_once __DIR__ . '/pages/options-connectors/page-wp-admin.php';
+foreach ( [
+ __DIR__ . '/pages/font-library/page.php',
+ __DIR__ . '/pages/font-library/page-wp-admin.php',
+ __DIR__ . '/pages/options-connectors/page.php',
+ __DIR__ . '/pages/options-connectors/page-wp-admin.php',
+] as $file ) {
+ if ( file_exists( $file ) ) {
+ require_once $file;
+ }
+}
diff --git a/src/wp-includes/build/pages/font-library/page-wp-admin.php b/src/wp-includes/build/pages/font-library/page-wp-admin.php
index b5974ceca1e53..355b56a777bc7 100644
--- a/src/wp-includes/build/pages/font-library/page-wp-admin.php
+++ b/src/wp-includes/build/pages/font-library/page-wp-admin.php
@@ -89,7 +89,7 @@ function wp_font_library_wp_admin_preload_data() {
// Define paths to preload - same for all pages
// Please also change packages/core-data/src/entities.js when changing this.
$preload_paths = array(
- '/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,image_output_formats,jpeg_interlaced,png_interlaced,gif_interlaced,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front',
+ '/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front',
array( '/wp/v2/settings', 'OPTIONS' ),
);
@@ -134,7 +134,9 @@ function wp_font_library_wp_admin_enqueue_scripts( $hook_suffix ) {
// Load build constants
$build_constants = require __DIR__ . '/../../constants.php';
- // Fire init action for extensions to register routes and menu items
+ /**
+ * Fires when the font-library admin page is initialized so extensions can register routes and menu items.
+ */
do_action( 'font-library-wp-admin_init' );
// Preload REST API data
@@ -219,6 +221,21 @@ function ( $handle ) {
}
}
+ /**
+ * Filters the boot script-module dependencies for the
+ * font-library-wp-admin page.
+ *
+ * Surfaces extending this page can append entries to the boot
+ * dependency list. Each entry is an array with 'import' (string
+ * 'static' or 'dynamic') and 'id' (script-module handle) keys.
+ *
+ * @param array $boot_dependencies Boot dependencies for the page.
+ */
+ $boot_dependencies = apply_filters(
+ 'font-library-wp-admin_boot_dependencies',
+ $boot_dependencies
+ );
+
// Dummy script module to ensure dependencies are loaded
wp_register_script_module(
'font-library-wp-admin',
@@ -243,9 +260,7 @@ function wp_font_library_wp_admin_render_page() {