Skip to content

Commit 74ad540

Browse files
committed
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develop into fix/dependency-enqueue-args
2 parents 1446ccf + 44f1517 commit 74ad540

Some content is hidden

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

57 files changed

+720
-305
lines changed

src/js/_enqueues/lib/auth-check.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,23 @@
159159
setShowTimeout();
160160
});
161161
}).on( 'heartbeat-tick.wp-auth-check', function( e, data ) {
162-
if ( 'wp-auth-check' in data ) {
162+
if ( ! ( 'wp-auth-check' in data ) ) {
163+
return;
164+
}
165+
166+
var showOrHide = function () {
163167
if ( ! data['wp-auth-check'] && wrap.hasClass( 'hidden' ) && ! tempHidden ) {
164168
show();
165169
} else if ( data['wp-auth-check'] && ! wrap.hasClass( 'hidden' ) ) {
166170
hide();
167171
}
172+
};
173+
174+
// This is necessary due to a race condition where the heartbeat-tick event may fire before DOMContentLoaded.
175+
if ( wrap ) {
176+
showOrHide();
177+
} else {
178+
$( showOrHide );
168179
}
169180
});
170181

src/wp-admin/customize.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
$body_class .= ' rtl';
148148
}
149149
$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
150+
$admin_color = get_user_option( 'admin_color' );
151+
$body_class .= ' admin-color-' . sanitize_html_class( is_string( $admin_color ) ? $admin_color : '', 'fresh' );
150152

151153
if ( wp_use_widgets_block_editor() ) {
152154
$body_class .= ' wp-embed-responsive';

src/wp-admin/includes/class-wp-debug-data.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,11 @@ private static function get_wp_constants(): array {
15921592
'value' => $db_collate,
15931593
'debug' => $db_collate_debug,
15941594
),
1595+
'EMPTY_TRASH_DAYS' => array(
1596+
'label' => 'EMPTY_TRASH_DAYS',
1597+
'value' => EMPTY_TRASH_DAYS ? EMPTY_TRASH_DAYS : __( 'Empty value' ),
1598+
'debug' => EMPTY_TRASH_DAYS,
1599+
),
15951600
);
15961601

15971602
return array(

src/wp-admin/includes/class-wp-ms-sites-list-table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ protected function site_states( $site ) {
674674

675675
if ( ! empty( $site_states ) ) {
676676
$state_count = count( $site_states );
677+
$separator = wp_get_list_item_separator();
677678

678679
$i = 0;
679680

@@ -682,9 +683,9 @@ protected function site_states( $site ) {
682683
foreach ( $site_states as $state ) {
683684
++$i;
684685

685-
$separator = ( $i < $state_count ) ? ', ' : '';
686+
$suffix = ( $i < $state_count ) ? $separator : '';
686687

687-
echo "<span class='post-state'>{$state}{$separator}</span>";
688+
echo "<span class='post-state'>{$state}{$suffix}</span>";
688689
}
689690
}
690691
}

src/wp-admin/includes/class-wp-upgrader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ public function install_package( $args = array() ) {
590590
* Filters the source file location for the upgrade package.
591591
*
592592
* @since 2.8.0
593-
* @since 4.4.0 The $hook_extra parameter became available.
593+
* @since 4.4.0 The `$hook_extra` parameter became available.
594594
*
595595
* @param string $source File source location.
596596
* @param string $remote_source Remote file source location.

src/wp-admin/includes/export.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,12 @@ function wxr_filter_postmeta( $return_me, $meta_key ) {
685685
endforeach;
686686

687687
$_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
688-
$comments = array_map( 'get_comment', $_comments );
688+
$comments = array_filter(
689+
array_map( 'get_comment', $_comments ),
690+
static function ( $comment ) {
691+
return $comment instanceof WP_Comment;
692+
}
693+
);
689694
foreach ( $comments as $c ) :
690695
?>
691696
<wp:comment>

src/wp-admin/includes/file.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,14 +1896,14 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
18961896
$uncompressed_size = 0;
18971897

18981898
// Determine any children directories needed (From within the archive).
1899-
foreach ( $archive_files as $file ) {
1900-
if ( str_starts_with( $file['filename'], '__MACOSX/' ) ) { // Skip the OS X-created __MACOSX directory.
1899+
foreach ( $archive_files as $archive_file ) {
1900+
if ( str_starts_with( $archive_file['filename'], '__MACOSX/' ) ) { // Skip the OS X-created __MACOSX directory.
19011901
continue;
19021902
}
19031903

1904-
$uncompressed_size += $file['size'];
1904+
$uncompressed_size += $archive_file['size'];
19051905

1906-
$needed_dirs[] = $to . untrailingslashit( $file['folder'] ? $file['filename'] : dirname( $file['filename'] ) );
1906+
$needed_dirs[] = $to . untrailingslashit( $archive_file['folder'] ? $archive_file['filename'] : dirname( $archive_file['filename'] ) );
19071907
}
19081908

19091909
// Enough space to unzip the file and copy its contents, with a 10% buffer.
@@ -1967,22 +1967,22 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
19671967
}
19681968

19691969
// Extract the files from the zip.
1970-
foreach ( $archive_files as $file ) {
1971-
if ( $file['folder'] ) {
1970+
foreach ( $archive_files as $archive_file ) {
1971+
if ( $archive_file['folder'] ) {
19721972
continue;
19731973
}
19741974

1975-
if ( str_starts_with( $file['filename'], '__MACOSX/' ) ) { // Don't extract the OS X-created __MACOSX directory files.
1975+
if ( str_starts_with( $archive_file['filename'], '__MACOSX/' ) ) { // Don't extract the OS X-created __MACOSX directory files.
19761976
continue;
19771977
}
19781978

19791979
// Don't extract invalid files:
1980-
if ( 0 !== validate_file( $file['filename'] ) ) {
1980+
if ( 0 !== validate_file( $archive_file['filename'] ) ) {
19811981
continue;
19821982
}
19831983

1984-
if ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE ) ) {
1985-
return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] );
1984+
if ( ! $wp_filesystem->put_contents( $to . $archive_file['filename'], $archive_file['content'], FS_CHMOD_FILE ) ) {
1985+
return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $archive_file['filename'] );
19861986
}
19871987
}
19881988

src/wp-admin/includes/media.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3769,8 +3769,8 @@ function wp_read_audio_metadata( $file ) {
37693769
* @link https://github.com/JamesHeinrich/getID3/blob/master/structure.txt
37703770
*
37713771
* @param array $metadata The metadata returned by getID3::analyze().
3772-
* @return int|false A UNIX timestamp for the media's creation date if available
3773-
* or a boolean FALSE if a timestamp could not be determined.
3772+
* @return int|false A Unix timestamp for the media's creation date if available
3773+
* or a boolean false if the timestamp could not be determined.
37743774
*/
37753775
function wp_get_media_creation_timestamp( $metadata ) {
37763776
$creation_date = false;

src/wp-admin/includes/post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
764764
if ( $create_in_db ) {
765765
$post_id = wp_insert_post(
766766
array(
767-
'post_title' => __( 'Auto Draft' ),
767+
'post_title' => post_type_supports( $post_type, 'title' ) ? __( 'Auto Draft' ) : '',
768768
'post_type' => $post_type,
769769
'post_status' => 'auto-draft',
770770
),
@@ -1894,7 +1894,7 @@ function _admin_notice_post_locked() {
18941894
* Fires inside the post locked dialog before the buttons are displayed.
18951895
*
18961896
* @since 3.6.0
1897-
* @since 5.4.0 The $user parameter was added.
1897+
* @since 5.4.0 The `$user` parameter was added.
18981898
*
18991899
* @param WP_Post $post Post object.
19001900
* @param WP_User $user The user with the lock for the post.

src/wp-admin/includes/template.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,6 +2251,7 @@ function _post_states( $post, $display = true ) {
22512251

22522252
if ( ! empty( $post_states ) ) {
22532253
$state_count = count( $post_states );
2254+
$separator = wp_get_list_item_separator();
22542255

22552256
$i = 0;
22562257

@@ -2259,9 +2260,9 @@ function _post_states( $post, $display = true ) {
22592260
foreach ( $post_states as $state ) {
22602261
++$i;
22612262

2262-
$separator = ( $i < $state_count ) ? ', ' : '';
2263+
$suffix = ( $i < $state_count ) ? $separator : '';
22632264

2264-
$post_states_html .= "<span class='post-state'>{$state}{$separator}</span>";
2265+
$post_states_html .= "<span class='post-state'>{$state}{$suffix}</span>";
22652266
}
22662267
}
22672268

@@ -2379,6 +2380,7 @@ function _media_states( $post, $display = true ) {
23792380

23802381
if ( ! empty( $media_states ) ) {
23812382
$state_count = count( $media_states );
2383+
$separator = wp_get_list_item_separator();
23822384

23832385
$i = 0;
23842386

@@ -2387,9 +2389,9 @@ function _media_states( $post, $display = true ) {
23872389
foreach ( $media_states as $state ) {
23882390
++$i;
23892391

2390-
$separator = ( $i < $state_count ) ? ', ' : '';
2392+
$suffix = ( $i < $state_count ) ? $separator : '';
23912393

2392-
$media_states_string .= "<span class='post-state'>{$state}{$separator}</span>";
2394+
$media_states_string .= "<span class='post-state'>{$state}{$suffix}</span>";
23932395
}
23942396
}
23952397

0 commit comments

Comments
 (0)