Skip to content

Commit 80bd9be

Browse files
Merge branch 'trunk' into combine-vendor-copy
2 parents 4522c52 + bccb9c1 commit 80bd9be

52 files changed

Lines changed: 1694 additions & 472 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://develop.svn.wordpress.org/trunk"
88
},
99
"gutenberg": {
10-
"sha": "0d133bf7e7437d65d68a06551f3d613a7d8e4361",
10+
"sha": "e2970ba736edb99e08fb369d4fb0c378189468ee",
1111
"ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build"
1212
},
1313
"engines": {

src/wp-admin/css/color-picker.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/* Needs higher specificity to override `.wp-core-ui .button`. */
1212
.wp-picker-container .wp-color-result.button {
13-
min-height: 30px;
13+
min-height: 32px;
1414
margin: 0 6px 6px 0;
1515
padding: 0 0 0 30px;
1616
font-size: 11px;
@@ -22,7 +22,7 @@
2222
border-left: 1px solid #c3c4c7;
2323
color: #50575e;
2424
display: block;
25-
line-height: 2.54545455; /* 28px */
25+
line-height: 2.72727273; /* 30px */
2626
padding: 0 6px;
2727
text-align: center;
2828
}
@@ -76,8 +76,8 @@
7676
.wp-customizer .wp-picker-input-wrap .button.wp-picker-clear {
7777
margin-left: 6px;
7878
padding: 0 8px;
79-
line-height: 2.54545455; /* 28px */
80-
min-height: 30px;
79+
line-height: 2.72727273; /* 30px */
80+
min-height: 32px;
8181
}
8282

8383
.wp-picker-container .iris-square-slider .ui-slider-handle:focus {
@@ -97,7 +97,7 @@
9797
margin: 0;
9898
padding: 0 5px;
9999
vertical-align: top;
100-
min-height: 30px;
100+
min-height: 32px;
101101
}
102102

103103
.wp-color-picker::-webkit-input-placeholder {

src/wp-admin/css/common.css

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,22 +1473,22 @@ div.error p,
14731473
color: #1e1e1e;
14741474
}
14751475

1476-
.notice a,
1477-
.error a,
1478-
.updated a {
1476+
div.notice a,
1477+
div.error a,
1478+
div.updated a {
14791479
color: var(--wp-admin-theme-color-darker-10);
14801480
text-decoration: underline;
14811481
}
14821482

1483-
.notice a:hover,
1484-
.error a:hover,
1485-
.updated a:hover {
1483+
div.notice a:hover,
1484+
div.error a:hover,
1485+
div.updated a:hover {
14861486
color: var(--wp-admin-theme-color-darker-20);
14871487
}
14881488

1489-
.notice a:focus,
1490-
.error a:focus,
1491-
.updated a:focus {
1489+
div.notice a:focus,
1490+
div.error a:focus,
1491+
div.updated a:focus {
14921492
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
14931493
outline: 2px solid transparent;
14941494
border-radius: 2px;
@@ -2281,7 +2281,7 @@ html.wp-toolbar {
22812281
line-height: 1;
22822282
}
22832283

2284-
.postbox.closed {
2284+
.postbox.closed .postbox-header {
22852285
border-bottom: 0;
22862286
}
22872287

@@ -3340,7 +3340,7 @@ img {
33403340
.postbox .handle-order-higher:focus,
33413341
.postbox .handle-order-lower:focus,
33423342
.postbox .handlediv:focus {
3343-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color);
3343+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color);
33443344
border-radius: 50%;
33453345
/* Only visible in Windows High Contrast mode */
33463346
outline: 2px solid transparent;

src/wp-admin/css/edit.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -994,15 +994,16 @@ form#tags-filter {
994994
}
995995

996996
.privacy-settings-accordion-actions {
997-
text-align: right;
998-
display: block;
997+
justify-content: right;
998+
display: flex;
999+
align-items: center;
1000+
flex-wrap: wrap;
1001+
gap: 1em;
9991002
}
10001003

10011004
.privacy-settings-accordion-actions .success {
10021005
display: none;
10031006
color: #007017;
1004-
padding-right: 1em;
1005-
padding-top: 6px;
10061007
}
10071008

10081009
.privacy-settings-accordion-actions .success.visible {

src/wp-admin/css/install.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ body {
1616
}
1717

1818
a {
19-
color: #2271b1;
19+
color: var(--wp-admin-theme-color);
2020
}
2121

2222
a:hover,
2323
a:active {
24-
color: #135e96;
24+
color: var(--wp-admin-theme-color-darker-20);
2525
}
2626

2727
a:focus {
28-
color: #043959;
28+
color: var(--wp-admin-theme-color-darker-20);
2929
border-radius: 2px;
3030
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color, #3858e9);
3131
/* Only visible in Windows High Contrast mode */

src/wp-includes/abilities-api/class-wp-ability.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,15 +502,27 @@ public function validate_input( $input = null ) {
502502
*
503503
* @param callable $callback The callable to invoke.
504504
* @param mixed $input Optional. The input data for the ability. Default `null`.
505-
* @return mixed The result of the callable execution.
505+
* @return mixed The result of the callable execution, or a `WP_Error` if the callback threw.
506506
*/
507507
protected function invoke_callback( callable $callback, $input = null ) {
508508
$args = array();
509509
if ( ! empty( $this->get_input_schema() ) ) {
510510
$args[] = $input;
511511
}
512512

513-
return $callback( ...$args );
513+
try {
514+
return $callback( ...$args );
515+
} catch ( Throwable $e ) {
516+
return new WP_Error(
517+
'ability_callback_exception',
518+
sprintf(
519+
/* translators: 1: Ability name, 2: Exception message. */
520+
__( 'Ability "%1$s" callback threw an exception: %2$s' ),
521+
esc_html( $this->name ),
522+
esc_html( $e->getMessage() )
523+
)
524+
);
525+
}
514526
}
515527

516528
/**

src/wp-includes/ai-client.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@
1717
* @return bool Whether AI features are supported.
1818
*/
1919
function wp_supports_ai(): bool {
20-
$is_enabled = defined( 'WP_AI_SUPPORT' ) ? WP_AI_SUPPORT : true;
20+
// Return early if AI is disabled by the current environment.
21+
if ( defined( 'WP_AI_SUPPORT' ) && ! WP_AI_SUPPORT ) {
22+
return false;
23+
}
2124

2225
/**
23-
* Filters whether the current request should use AI.
26+
* Filters whether the current request can use AI.
2427
*
2528
* This allows plugins and 3rd-party code to disable AI features on a per-request basis, or to even override explicit
2629
* preferences defined by the site owner.
2730
*
2831
* @since 7.0.0
2932
*
30-
* @param bool $is_enabled Whether the current request should use AI. Default to WP_AI_SUPPORT constant, or true if
31-
* the constant is not defined.
33+
* @param bool $is_enabled Whether AI is available. Default to true.
3234
*/
33-
return (bool) apply_filters( 'wp_supports_ai', $is_enabled );
35+
return (bool) apply_filters( 'wp_supports_ai', true );
3436
}
3537

3638
/**

src/wp-includes/assets/script-loader-packages.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
'wp-url',
101101
'wp-warning'
102102
),
103-
'version' => '0c1dfcebf759791c9a8b'
103+
'version' => '2300d40abe29e438beda'
104104
),
105105
'block-library.js' => array(
106106
'dependencies' => array(
@@ -142,7 +142,7 @@
142142
'import' => 'dynamic'
143143
)
144144
),
145-
'version' => 'd72ed53f961f90f21ed4'
145+
'version' => '67d1a681ec0100a25d78'
146146
),
147147
'block-serialization-default-parser.js' => array(
148148
'dependencies' => array(
@@ -428,7 +428,7 @@
428428
'import' => 'static'
429429
)
430430
),
431-
'version' => 'a688ac97344ffdfcca99'
431+
'version' => 'd36eb0c37b644e4cd4c8'
432432
),
433433
'edit-widgets.js' => array(
434434
'dependencies' => array(
@@ -519,7 +519,7 @@
519519
'import' => 'static'
520520
)
521521
),
522-
'version' => '49ff59c135229f1cc371'
522+
'version' => '63782008412a6163c9f0'
523523
),
524524
'element.js' => array(
525525
'dependencies' => array(
@@ -817,7 +817,7 @@
817817
'wp-hooks',
818818
'wp-private-apis'
819819
),
820-
'version' => '89ec294039260fd01952'
820+
'version' => '8186bfbc15b827d261f5'
821821
),
822822
'theme.js' => array(
823823
'dependencies' => array(

src/wp-includes/assets/script-modules-packages.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
'import' => 'static'
167167
)
168168
),
169-
'version' => '105defe2f1526f8a43e8'
169+
'version' => '42d3f09bba14cce3054d'
170170
),
171171
'connectors/index.js' => array(
172172
'dependencies' => array(
@@ -177,7 +177,7 @@
177177
'wp-i18n',
178178
'wp-private-apis'
179179
),
180-
'version' => 'e973aa806299e3d70144'
180+
'version' => '274797868955a828dfdc'
181181
),
182182
'core-abilities/index.js' => array(
183183
'dependencies' => array(

src/wp-includes/blocks.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,7 @@ function apply_block_hooks_to_content( $content, $context = null, $callback = 'i
11961196
* of the block that corresponds to the post type are handled correctly.
11971197
*
11981198
* @since 6.8.0
1199+
* @since 7.0.0 Added the `$ignored_hooked_blocks_at_root` parameter.
11991200
* @access private
12001201
*
12011202
* @param string $content Serialized content.
@@ -1205,9 +1206,17 @@ function apply_block_hooks_to_content( $content, $context = null, $callback = 'i
12051206
* @param callable $callback A function that will be called for each block to generate
12061207
* the markup for a given list of blocks that are hooked to it.
12071208
* Default: 'insert_hooked_blocks'.
1209+
* @param array|null $ignored_hooked_blocks_at_root A reference to an array that will be populated
1210+
* with the ignored hooked blocks at the root level.
1211+
* Default: `null`.
12081212
* @return string The serialized markup.
12091213
*/
1210-
function apply_block_hooks_to_content_from_post_object( $content, $post = null, $callback = 'insert_hooked_blocks' ) {
1214+
function apply_block_hooks_to_content_from_post_object(
1215+
$content,
1216+
$post = null,
1217+
$callback = 'insert_hooked_blocks',
1218+
&$ignored_hooked_blocks_at_root = null
1219+
) {
12111220
// Default to the current post if no context is provided.
12121221
if ( null === $post ) {
12131222
$post = get_post();
@@ -1287,6 +1296,16 @@ function apply_block_hooks_to_content_from_post_object( $content, $post = null,
12871296
$content = apply_block_hooks_to_content( $content, $post, $callback );
12881297
remove_filter( 'hooked_block_types', $suppress_blocks_from_insertion_before_and_after_wrapper_block, PHP_INT_MAX );
12891298

1299+
if ( null !== $ignored_hooked_blocks_at_root ) {
1300+
// Check wrapper block's metadata for ignored hooked blocks at the root level, and populate the reference parameter if needed.
1301+
$wrapper_block_markup = extract_serialized_parent_block( $content );
1302+
$wrapper_block = parse_blocks( $wrapper_block_markup )[0];
1303+
1304+
if ( ! empty( $wrapper_block['attrs']['metadata']['ignoredHookedBlocks'] ) ) {
1305+
$ignored_hooked_blocks_at_root = $wrapper_block['attrs']['metadata']['ignoredHookedBlocks'];
1306+
}
1307+
}
1308+
12901309
// Finally, we need to remove the temporary wrapper block.
12911310
$content = remove_serialized_parent_block( $content );
12921311

@@ -1449,6 +1468,7 @@ function insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata( &$parsed_a
14491468
*
14501469
* @since 6.6.0
14511470
* @since 6.8.0 Support non-`wp_navigation` post types.
1471+
* @since 7.0.0 Set `_wp_ignored_hooked_blocks` meta in the response for blocks hooked at the root level.
14521472
*
14531473
* @param WP_REST_Response $response The response object.
14541474
* @param WP_Post $post Post object.
@@ -1459,12 +1479,18 @@ function insert_hooked_blocks_into_rest_response( $response, $post ) {
14591479
return $response;
14601480
}
14611481

1482+
$ignored_hooked_blocks_at_root = array();
14621483
$response->data['content']['raw'] = apply_block_hooks_to_content_from_post_object(
14631484
$response->data['content']['raw'],
14641485
$post,
1465-
'insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata'
1486+
'insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata',
1487+
$ignored_hooked_blocks_at_root
14661488
);
14671489

1490+
if ( ! empty( $ignored_hooked_blocks_at_root ) ) {
1491+
$response->data['meta']['_wp_ignored_hooked_blocks'] = wp_json_encode( $ignored_hooked_blocks_at_root );
1492+
}
1493+
14681494
// If the rendered content was previously empty, we leave it like that.
14691495
if ( empty( $response->data['content']['rendered'] ) ) {
14701496
return $response;

0 commit comments

Comments
 (0)