Skip to content

Commit beb3a42

Browse files
committed
Merge branch 'trunk' into 64564-get-block-wrapper-attributes
2 parents 9445bd3 + 68c0f19 commit beb3a42

35 files changed

Lines changed: 764 additions & 197 deletions

src/js/_enqueues/wp/util.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ window.wp = window.wp || {};
3636
};
3737

3838
return function ( data ) {
39-
if ( ! document.getElementById( 'tmpl-' + id ) ) {
39+
var el = document.querySelector( 'script#tmpl-' + id );
40+
if ( ! el ) {
4041
throw new Error( 'Template not found: ' + '#tmpl-' + id );
4142
}
42-
compiled = compiled || _.template( $( '#tmpl-' + id ).html(), options );
43+
compiled = compiled || _.template( $( el ).html(), options );
4344
return compiled( data );
4445
};
4546
});

src/wp-admin/css/common.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2263,8 +2263,9 @@ html.wp-toolbar {
22632263
color: #a7aaad;
22642264
}
22652265

2266-
.sortable-placeholder {
2266+
.sortable-placeholder:not(.empty-container .sortable-placeholder) {
22672267
border: 1px dashed #c3c4c7;
2268+
border-radius: 8px;
22682269
margin-bottom: 20px;
22692270
}
22702271

src/wp-admin/css/dashboard.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
}
8484

8585
.is-dragging-metaboxes #dashboard-widgets .postbox-container .empty-container {
86-
outline: 2px dashed rgb(0, 0, 0, 0.15);
8786
background: rgb(0, 0, 0, 0.01);
8887
}
8988

src/wp-admin/includes/ajax-actions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,7 +2382,7 @@ function wp_ajax_save_widget() {
23822382
*/
23832383
do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
23842384

2385-
/** This action is documented in wp-admin/widgets.php */
2385+
/** This action is documented in wp-admin/widgets-form.php */
23862386
do_action( 'sidebar_admin_setup' );
23872387

23882388
$id_base = wp_unslash( $_POST['id_base'] );
@@ -2410,7 +2410,7 @@ function wp_ajax_save_widget() {
24102410
'delete_widget' => '1',
24112411
);
24122412

2413-
/** This action is documented in wp-admin/widgets.php */
2413+
/** This action is documented in wp-admin/widgets-form.php */
24142414
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
24152415

24162416
} elseif ( $settings && preg_match( '/__i__|%i%/', key( $settings ) ) ) {
@@ -2486,7 +2486,7 @@ function wp_ajax_delete_inactive_widgets() {
24862486
do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
24872487
/** This action is documented in wp-admin/includes/ajax-actions.php */
24882488
do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
2489-
/** This action is documented in wp-admin/widgets.php */
2489+
/** This action is documented in wp-admin/widgets-form.php */
24902490
do_action( 'sidebar_admin_setup' );
24912491

24922492
$sidebars_widgets = wp_get_sidebars_widgets();

src/wp-admin/includes/class-walker-nav-menu-checklist.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ public function start_el( &$output, $data_object, $depth = 0, $args = null, $cur
116116
$output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="' . esc_attr( $menu_item->object ) . '" />';
117117
$output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="' . esc_attr( $menu_item->menu_item_parent ) . '" />';
118118
$output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="' . esc_attr( $menu_item->type ) . '" />';
119-
$output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . esc_attr( $menu_item->title ) . '" />';
119+
$output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . htmlspecialchars( $menu_item->title, ENT_QUOTES ) . '" />';
120120
$output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="' . esc_url( $menu_item->url ) . '" />';
121121
$output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="' . esc_attr( $menu_item->target ) . '" />';
122-
$output .= '<input type="hidden" class="menu-item-attr-title" name="menu-item[' . $possible_object_id . '][menu-item-attr-title]" value="' . esc_attr( $menu_item->attr_title ) . '" />';
123-
$output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . esc_attr( implode( ' ', $menu_item->classes ) ) . '" />';
124-
$output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="' . esc_attr( $menu_item->xfn ) . '" />';
122+
$output .= '<input type="hidden" class="menu-item-attr-title" name="menu-item[' . $possible_object_id . '][menu-item-attr-title]" value="' . htmlspecialchars( $menu_item->attr_title, ENT_QUOTES ) . '" />';
123+
$output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . htmlspecialchars( implode( ' ', $menu_item->classes ), ENT_QUOTES ) . '" />';
124+
$output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="' . htmlspecialchars( $menu_item->xfn, ENT_QUOTES ) . '" />';
125125
}
126126
}

src/wp-admin/includes/class-walker-nav-menu-edit.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ public function start_el( &$output, $data_object, $depth = 0, $args = null, $cur
203203
<p class="description description-wide">
204204
<label for="edit-menu-item-title-<?php echo $item_id; ?>">
205205
<?php _e( 'Navigation Label' ); ?><br />
206-
<input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->title ); ?>" />
206+
<input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo htmlspecialchars( $menu_item->title, ENT_QUOTES ); ?>" />
207207
</label>
208208
</p>
209209
<p class="field-title-attribute field-attr-title description description-wide">
210210
<label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
211211
<?php _e( 'Title Attribute' ); ?><br />
212-
<input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->post_excerpt ); ?>" />
212+
<input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo htmlspecialchars( $menu_item->post_excerpt, ENT_QUOTES ); ?>" />
213213
</label>
214214
</p>
215215
<p class="field-link-target description">
@@ -222,20 +222,20 @@ public function start_el( &$output, $data_object, $depth = 0, $args = null, $cur
222222
<p class="field-css-classes description description-thin">
223223
<label for="edit-menu-item-classes-<?php echo $item_id; ?>">
224224
<?php _e( 'CSS Classes (optional)' ); ?><br />
225-
<input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode( ' ', $menu_item->classes ) ); ?>" />
225+
<input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo htmlspecialchars( implode( ' ', $menu_item->classes ), ENT_QUOTES ); ?>" />
226226
</label>
227227
</p>
228228
<p class="field-xfn description description-thin">
229229
<label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
230230
<?php _e( 'Link Relationship (XFN)' ); ?><br />
231-
<input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->xfn ); ?>" />
231+
<input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo htmlspecialchars( $menu_item->xfn, ENT_QUOTES ); ?>" />
232232
</label>
233233
</p>
234234
</div>
235235
<p class="field-description description description-wide">
236236
<label for="edit-menu-item-description-<?php echo $item_id; ?>">
237237
<?php _e( 'Description' ); ?><br />
238-
<textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $menu_item->description ); // textarea_escaped ?></textarea>
238+
<textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_textarea( $menu_item->description ); // textarea_escaped ?></textarea>
239239
<span class="description"><?php _e( 'The description will be displayed in the menu if the active theme supports it.' ); ?></span>
240240
</label>
241241
</p>

src/wp-admin/includes/file.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,11 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
18951895
continue;
18961896
}
18971897

1898+
// Don't extract invalid files:
1899+
if ( 0 !== validate_file( $archive_file['filename'] ) ) {
1900+
continue;
1901+
}
1902+
18981903
$uncompressed_size += $archive_file['size'];
18991904

19001905
$needed_dirs[] = $to . untrailingslashit( $archive_file['folder'] ? $archive_file['filename'] : dirname( $archive_file['filename'] ) );

src/wp-admin/includes/ms.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
9797
if ( $drop ) {
9898
wp_delete_site( $blog_id );
9999
} else {
100-
/** This action is documented in wp-includes/ms-blogs.php */
100+
/** This action is documented in wp-includes/ms-site.php */
101101
do_action_deprecated( 'delete_blog', array( $blog_id, false ), '5.1.0' );
102102

103103
$users = get_users(
@@ -116,7 +116,7 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
116116

117117
update_blog_status( $blog_id, 'deleted', 1 );
118118

119-
/** This action is documented in wp-includes/ms-blogs.php */
119+
/** This action is documented in wp-includes/ms-site.php */
120120
do_action_deprecated( 'deleted_blog', array( $blog_id, false ), '5.1.0' );
121121
}
122122

src/wp-includes/ID3/getid3.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
if (!defined('GETID3_LIBXML_OPTIONS') && defined('LIBXML_VERSION')) {
1515
if (LIBXML_VERSION >= 20621) {
16-
define('GETID3_LIBXML_OPTIONS', LIBXML_NOENT | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_COMPACT);
16+
define('GETID3_LIBXML_OPTIONS', LIBXML_NONET | LIBXML_NOWARNING | LIBXML_COMPACT);
1717
} else {
18-
define('GETID3_LIBXML_OPTIONS', LIBXML_NOENT | LIBXML_NONET | LIBXML_NOWARNING);
18+
define('GETID3_LIBXML_OPTIONS', LIBXML_NONET | LIBXML_NOWARNING);
1919
}
2020
}
2121

src/wp-includes/admin-bar.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,44 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
934934
}
935935
}
936936

937+
/**
938+
* Adds the command palette trigger button.
939+
*
940+
* Displays a button in the admin bar that shows the keyboard shortcut
941+
* for opening the command palette.
942+
*
943+
* @since 7.0.0
944+
*
945+
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
946+
*/
947+
function wp_admin_bar_command_palette_menu( WP_Admin_Bar $wp_admin_bar ): void {
948+
if ( ! is_admin() ) {
949+
return;
950+
}
951+
952+
$is_apple_os = (bool) preg_match( '/Macintosh|Mac OS X|Mac_PowerPC/i', $_SERVER['HTTP_USER_AGENT'] ?? '' );
953+
$shortcut_label = $is_apple_os
954+
? _x( '⌘K', 'keyboard shortcut to open the command palette' )
955+
: _x( 'Ctrl+K', 'keyboard shortcut to open the command palette' );
956+
$title = sprintf(
957+
'<span class="ab-label"><kbd>%s</kbd><span class="screen-reader-text"> %s</span></span>',
958+
$shortcut_label,
959+
/* translators: Hidden accessibility text. */
960+
__( 'Open command palette' ),
961+
);
962+
$wp_admin_bar->add_node(
963+
array(
964+
'id' => 'command-palette',
965+
'title' => $title,
966+
'href' => '#',
967+
'meta' => array(
968+
'class' => 'hide-if-no-js',
969+
'onclick' => 'wp.data.dispatch( "core/commands" ).open(); return false;',
970+
),
971+
)
972+
);
973+
}
974+
937975
/**
938976
* Adds "Add New" menu.
939977
*

0 commit comments

Comments
 (0)