Skip to content

Commit b33ce16

Browse files
Merge branch 'trunk' into backport-finalize-endpoint
2 parents 8af2fa6 + f29f594 commit b33ce16

16 files changed

Lines changed: 636 additions & 170 deletions

Gruntfile.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,17 @@ module.exports = function(grunt) {
612612
dest: WORKING_DIR + 'wp-includes/build/',
613613
} ],
614614
},
615+
'gutenberg-js': {
616+
files: [ {
617+
expand: true,
618+
cwd: 'gutenberg/build',
619+
src: [
620+
'pages/**/*.js',
621+
'routes/**/*.js',
622+
],
623+
dest: WORKING_DIR + 'wp-includes/build/',
624+
} ],
625+
},
615626
'gutenberg-modules': {
616627
files: [ {
617628
expand: true,
@@ -2041,6 +2052,7 @@ module.exports = function(grunt) {
20412052

20422053
grunt.registerTask( 'build:gutenberg', [
20432054
'copy:gutenberg-php',
2055+
'copy:gutenberg-js',
20442056
'gutenberg:copy',
20452057
'copy:gutenberg-modules',
20462058
'copy:gutenberg-styles',

src/wp-admin/includes/file.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
19581958
}
19591959
}
19601960

1961-
/** This filter is documented in src/wp-admin/includes/file.php */
1961+
/** This filter is documented in wp-admin/includes/file.php */
19621962
$pre = apply_filters( 'pre_unzip_file', null, $file, $to, $needed_dirs, $required_space );
19631963

19641964
if ( null !== $pre ) {
@@ -1985,7 +1985,7 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
19851985
}
19861986
}
19871987

1988-
/** This action is documented in src/wp-admin/includes/file.php */
1988+
/** This filter is documented in wp-admin/includes/file.php */
19891989
$result = apply_filters( 'unzip_file', true, $file, $to, $needed_dirs, $required_space );
19901990

19911991
unset( $needed_dirs );

src/wp-includes/admin-bar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
945945
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
946946
*/
947947
function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
948-
if ( ! is_admin() ) {
948+
if ( ! is_admin() || ! wp_script_is( 'wp-core-commands', 'enqueued' ) ) {
949949
return;
950950
}
951951

@@ -954,7 +954,7 @@ function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
954954
? _x( '⌘K', 'keyboard shortcut to open the command palette' )
955955
: _x( 'Ctrl+K', 'keyboard shortcut to open the command palette' );
956956
$title = sprintf(
957-
'<span class="ab-label"><kbd>%s</kbd><span class="screen-reader-text"> %s</span></span>',
957+
'<span class="ab-icon" aria-hidden="true"></span><span class="ab-label"><kbd>%s</kbd><span class="screen-reader-text"> %s</span></span>',
958958
$shortcut_label,
959959
/* translators: Hidden accessibility text. */
960960
__( 'Open command palette' ),

src/wp-includes/class-wp-customize-widgets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ public function enqueue_scripts() {
897897
wp_enqueue_script( 'wp-customize-widgets' );
898898
wp_enqueue_style( 'wp-customize-widgets' );
899899

900-
/** This action is documented in edit-form-blocks.php */
900+
/** This action is documented in wp-admin/edit-form-blocks.php */
901901
do_action( 'enqueue_block_editor_assets' );
902902
}
903903
}

src/wp-includes/css/admin-bar.css

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,22 @@ html:lang(he-il) .rtl #wpadminbar * {
694694
display: none;
695695
}
696696

697+
/**
698+
* Command Palette
699+
*/
700+
#wpadminbar #wp-admin-bar-command-palette .ab-icon {
701+
display: none; /* Icon displayed only on mobile */
702+
}
703+
704+
#wpadminbar #wp-admin-bar-command-palette .ab-icon:before {
705+
content: "\f179";
706+
content: "\f179" / '';
707+
}
708+
709+
#wpadminbar #wp-admin-bar-command-palette kbd {
710+
background: transparent;
711+
}
712+
697713
/**
698714
* Customize support classes
699715
*/
@@ -892,7 +908,8 @@ html:lang(he-il) .rtl #wpadminbar * {
892908
#wpadminbar #wp-admin-bar-site-name > .ab-item:before,
893909
#wpadminbar #wp-admin-bar-site-editor > .ab-item:before,
894910
#wpadminbar #wp-admin-bar-customize > .ab-item:before,
895-
#wpadminbar #wp-admin-bar-my-account > .ab-item:before {
911+
#wpadminbar #wp-admin-bar-my-account > .ab-item:before,
912+
#wpadminbar #wp-admin-bar-command-palette .ab-icon:before {
896913
display: block;
897914
text-indent: 0;
898915
font: normal 32px/1 dashicons;
@@ -935,12 +952,18 @@ html:lang(he-il) .rtl #wpadminbar * {
935952
top: 3px;
936953
}
937954

938-
/* Comments */
939-
#wpadminbar #wp-admin-bar-comments .ab-icon {
955+
/* Comments and Command Palette */
956+
#wpadminbar #wp-admin-bar-comments .ab-icon,
957+
#wpadminbar #wp-admin-bar-command-palette .ab-icon {
940958
margin: 0;
941959
}
942960

943-
#wpadminbar #wp-admin-bar-comments .ab-icon:before {
961+
#wpadminbar #wp-admin-bar-command-palette .ab-icon {
962+
display: block; /* Icon is only shown on mobile, while the keyboard shortcut is hidden */
963+
}
964+
965+
#wpadminbar #wp-admin-bar-comments .ab-icon:before,
966+
#wpadminbar #wp-admin-bar-command-palette .ab-icon:before {
944967
display: block;
945968
font-size: 34px;
946969
height: 46px;
@@ -1009,7 +1032,8 @@ html:lang(he-il) .rtl #wpadminbar * {
10091032
#wpadminbar li#wp-admin-bar-new-content,
10101033
#wpadminbar li#wp-admin-bar-edit,
10111034
#wpadminbar li#wp-admin-bar-comments,
1012-
#wpadminbar li#wp-admin-bar-my-account {
1035+
#wpadminbar li#wp-admin-bar-my-account,
1036+
#wpadminbar li#wp-admin-bar-command-palette {
10131037
display: block;
10141038
}
10151039

@@ -1040,7 +1064,8 @@ html:lang(he-il) .rtl #wpadminbar * {
10401064
#wpadminbar #wp-admin-bar-comments,
10411065
#wpadminbar #wp-admin-bar-new-content,
10421066
#wpadminbar #wp-admin-bar-edit,
1043-
#wpadminbar #wp-admin-bar-my-account {
1067+
#wpadminbar #wp-admin-bar-my-account,
1068+
#wpadminbar #wp-admin-bar-command-palette {
10441069
position: static;
10451070
}
10461071

src/wp-includes/default-filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@
607607
add_action( 'enqueue_block_assets', 'wp_enqueue_classic_theme_styles' );
608608
add_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
609609
add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
610-
add_action( 'init', 'wp_load_classic_theme_block_styles_on_demand', 8 ); // Must happen before register_core_block_style_handles() at priority 9.
610+
add_action( 'wp_default_styles', 'wp_load_classic_theme_block_styles_on_demand', 0 ); // Must happen before wp_default_styles() and register_core_block_style_handles().
611611
/*
612612
* `wp_enqueue_registered_block_scripts_and_styles` is bound to both
613613
* `enqueue_block_editor_assets` and `enqueue_block_assets` hooks

src/wp-includes/deprecated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4790,7 +4790,7 @@ function wp_img_tag_add_loading_attr( $image, $context ) {
47904790
return $image;
47914791
}
47924792

4793-
/** This filter is documented in wp-admin/includes/media.php */
4793+
/** This filter is documented in wp-includes/media.php */
47944794
$value = apply_filters( 'wp_img_tag_add_loading_attr', $value, $image, $context );
47954795

47964796
if ( $value ) {

src/wp-includes/media.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6411,14 +6411,18 @@ function wp_get_image_editor_output_format( $filename, $mime_type ) {
64116411
* @return bool Whether client-side media processing is enabled.
64126412
*/
64136413
function wp_is_client_side_media_processing_enabled(): bool {
6414+
// This is due to SharedArrayBuffer requiring a secure context.
6415+
$host = strtolower( (string) strtok( $_SERVER['HTTP_HOST'] ?? '', ':' ) );
6416+
$enabled = ( is_ssl() || 'localhost' === $host || str_ends_with( $host, '.localhost' ) );
6417+
64146418
/**
64156419
* Filters whether client-side media processing is enabled.
64166420
*
64176421
* @since 7.0.0
64186422
*
6419-
* @param bool $enabled Whether client-side media processing is enabled. Default true.
6423+
* @param bool $enabled Whether client-side media processing is enabled. Default true if the page is served in a secure context.
64206424
*/
6421-
return (bool) apply_filters( 'wp_client_side_media_processing_enabled', true );
6425+
return (bool) apply_filters( 'wp_client_side_media_processing_enabled', $enabled );
64226426
}
64236427

64246428
/**
@@ -6431,7 +6435,7 @@ function wp_set_client_side_media_processing_flag(): void {
64316435
return;
64326436
}
64336437

6434-
wp_add_inline_script( 'wp-block-editor', 'window.__clientSideMediaProcessing = true', 'before' );
6438+
wp_add_inline_script( 'wp-block-editor', 'window.__clientSideMediaProcessing = true;', 'before' );
64356439

64366440
$chromium_version = wp_get_chromium_major_version();
64376441

@@ -6477,6 +6481,10 @@ function wp_get_chromium_major_version(): ?int {
64776481
* media processing in the editor. Uses Document-Isolation-Policy
64786482
* on supported browsers (Chromium 137+).
64796483
*
6484+
* Skips setup when a third-party page builder overrides the block
6485+
* editor via a custom `action` query parameter, as DIP would block
6486+
* same-origin iframe access that these editors rely on.
6487+
*
64806488
* @since 7.0.0
64816489
*/
64826490
function wp_set_up_cross_origin_isolation(): void {
@@ -6494,6 +6502,15 @@ function wp_set_up_cross_origin_isolation(): void {
64946502
return;
64956503
}
64966504

6505+
/*
6506+
* Skip when a third-party page builder overrides the block editor.
6507+
* DIP isolates the document into its own agent cluster,
6508+
* which blocks same-origin iframe access that these editors rely on.
6509+
*/
6510+
if ( isset( $_GET['action'] ) && 'edit' !== $_GET['action'] ) {
6511+
return;
6512+
}
6513+
64976514
// Cross-origin isolation is not needed if users can't upload files anyway.
64986515
if ( ! current_user_can( 'upload_files' ) ) {
64996516
return;

src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ public function create_item_permissions_check( $request ) {
252252
*/
253253
$prevent_unsupported_uploads = apply_filters( 'wp_prevent_unsupported_mime_type_uploads', true, $files['file']['type'] ?? null );
254254

255+
// When the client handles image processing (generate_sub_sizes is false),
256+
// skip the server-side image editor support check.
257+
if ( false === $request['generate_sub_sizes'] ) {
258+
$prevent_unsupported_uploads = false;
259+
}
260+
255261
// If the upload is an image, check if the server can handle the mime type.
256262
if (
257263
$prevent_unsupported_uploads &&
@@ -298,7 +304,7 @@ public function create_item( $request ) {
298304
}
299305

300306
// Handle generate_sub_sizes parameter.
301-
if ( isset( $request['generate_sub_sizes'] ) && ! $request['generate_sub_sizes'] ) {
307+
if ( false === $request['generate_sub_sizes'] ) {
302308
add_filter( 'intermediate_image_sizes_advanced', '__return_empty_array', 100 );
303309
add_filter( 'fallback_intermediate_image_sizes', '__return_empty_array', 100 );
304310
// Disable server-side EXIF rotation so the client can handle it.

src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public function create_post_autosave( $post_data, array $meta = array() ) {
436436
$new_autosave['ID'] = $old_autosave->ID;
437437
$new_autosave['post_author'] = $user_id;
438438

439-
/** This filter is documented in wp-admin/post.php */
439+
/** This action is documented in wp-admin/includes/post.php */
440440
do_action( 'wp_creating_autosave', $new_autosave );
441441

442442
// wp_update_post() expects escaped array.

0 commit comments

Comments
 (0)