summaryrefslogtreecommitdiffstatshomepage
path: root/src/wp-admin
diff options
context:
space:
mode:
Diffstat (limited to 'src/wp-admin')
-rw-r--r--src/wp-admin/async-upload.php19
-rw-r--r--src/wp-admin/css/common.css4
-rw-r--r--src/wp-admin/css/list-tables.css8
-rw-r--r--src/wp-admin/css/revisions.css30
-rw-r--r--src/wp-admin/edit-comments.php2
-rw-r--r--src/wp-admin/includes/ajax-actions.php8
-rw-r--r--src/wp-admin/includes/class-custom-image-header.php2
-rw-r--r--src/wp-admin/includes/class-language-pack-upgrader.php2
-rw-r--r--src/wp-admin/includes/class-wp-automatic-updater.php2
-rw-r--r--src/wp-admin/includes/class-wp-community-events.php8
-rw-r--r--src/wp-admin/includes/class-wp-debug-data.php23
-rw-r--r--src/wp-admin/includes/class-wp-filesystem-ftpext.php9
-rw-r--r--src/wp-admin/includes/class-wp-filesystem-ftpsockets.php4
-rw-r--r--src/wp-admin/includes/class-wp-list-table.php4
-rw-r--r--src/wp-admin/includes/class-wp-ms-sites-list-table.php18
-rw-r--r--src/wp-admin/includes/class-wp-site-health.php2
-rw-r--r--src/wp-admin/includes/file.php2
-rw-r--r--src/wp-admin/includes/media.php2
-rw-r--r--src/wp-admin/includes/misc.php8
-rw-r--r--src/wp-admin/includes/post.php2
-rw-r--r--src/wp-admin/includes/revision.php72
-rw-r--r--src/wp-admin/includes/taxonomy.php2
-rw-r--r--src/wp-admin/includes/template.php3
-rw-r--r--src/wp-admin/includes/update-core.php1
-rw-r--r--src/wp-admin/includes/upgrade.php2
-rw-r--r--src/wp-admin/install.php4
-rw-r--r--src/wp-admin/menu.php2
-rw-r--r--src/wp-admin/nav-menus.php2
-rw-r--r--src/wp-admin/network/site-info.php2
-rw-r--r--src/wp-admin/network/site-new.php2
-rw-r--r--src/wp-admin/network/sites.php44
-rw-r--r--src/wp-admin/options-discussion.php2
-rw-r--r--src/wp-admin/options.php17
-rw-r--r--src/wp-admin/post.php2
-rw-r--r--src/wp-admin/upgrade.php4
-rw-r--r--src/wp-admin/user-edit.php30
36 files changed, 230 insertions, 120 deletions
diff --git a/src/wp-admin/async-upload.php b/src/wp-admin/async-upload.php
index 2ac2f20e76..135568507c 100644
--- a/src/wp-admin/async-upload.php
+++ b/src/wp-admin/async-upload.php
@@ -112,12 +112,14 @@ if ( isset( $_REQUEST['post_id'] ) ) {
$id = media_handle_upload( 'async-upload', $post_id );
if ( is_wp_error( $id ) ) {
- $button_unique_id = uniqid( 'dismiss-' );
- $message = sprintf(
+ $button_unique_id = uniqid( 'dismiss-' );
+ $error_description_id = uniqid( 'error-description-' );
+ $message = sprintf(
'%s <strong>%s</strong><br />%s',
sprintf(
- '<button type="button" id="%s" class="dismiss button-link">%s</button>',
+ '<button type="button" id="%1$s" class="dismiss button-link" aria-describedby="%2$s">%3$s</button>',
esc_attr( $button_unique_id ),
+ esc_attr( $error_description_id ),
__( 'Dismiss' )
),
sprintf(
@@ -127,14 +129,23 @@ if ( is_wp_error( $id ) ) {
),
esc_html( $id->get_error_message() )
);
+
wp_admin_notice(
$message,
array(
+ 'id' => $error_description_id,
'additional_classes' => array( 'error-div', 'error' ),
'paragraph_wrap' => false,
)
);
- echo "<script>jQuery( 'button#{$button_unique_id}' ).on( 'click', function() {jQuery(this).parents('div.media-item').slideUp(200, function(){jQuery(this).remove();})});</script>\n";
+
+ $speak_message = sprintf(
+ /* translators: %s: Name of the file that failed to upload. */
+ __( '%s has failed to upload.' ),
+ esc_js( $_FILES['async-upload']['name'] )
+ );
+
+ echo "<script>_.delay(function() {wp.a11y.speak('" . esc_js( $speak_message ) . "');}, 1500);jQuery( 'button#{$button_unique_id}' ).on( 'click', function() {jQuery(this).parents('div.media-item').slideUp(200, function(){jQuery(this).remove();wp.a11y.speak( wp.i18n.__( 'Error dismissed.' ) );jQuery( '#plupload-browse-button' ).trigger( 'focus' );})});</script>\n";
exit;
}
diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css
index c008d784ce..f8764e2b2d 100644
--- a/src/wp-admin/css/common.css
+++ b/src/wp-admin/css/common.css
@@ -3912,6 +3912,10 @@ img {
top: 7px;
}
+ .screen-reader-shortcut[href="#wp-toolbar"] {
+ display: none;
+ }
+
body {
min-width: 240px;
overflow-x: hidden;
diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css
index da4bb599be..bc38d64b38 100644
--- a/src/wp-admin/css/list-tables.css
+++ b/src/wp-admin/css/list-tables.css
@@ -2064,7 +2064,6 @@ div.action-links,
}
.row-actions {
- margin-left: -8px;
margin-right: -8px;
padding-top: 4px;
}
@@ -2077,10 +2076,15 @@ div.action-links,
color: transparent;
}
+ .row-actions span {
+ font-size: 0;
+ }
+
.row-actions span a,
.row-actions span .button-link {
display: inline-block;
- padding: 4px 8px;
+ padding: 4px 16px 4px 0;
+ font-size: 13px;
line-height: 1.5;
}
diff --git a/src/wp-admin/css/revisions.css b/src/wp-admin/css/revisions.css
index 9d3a0b3a91..e16143cf48 100644
--- a/src/wp-admin/css/revisions.css
+++ b/src/wp-admin/css/revisions.css
@@ -572,6 +572,28 @@ div.revisions-controls > .wp-slider > .ui-slider-handle {
}
}
+@media screen and (max-width: 600px) {
+ .revisions-meta .author-card:not(.comparing-two-revisions .author-card) {
+ display: flex;
+ flex-direction: column;
+ width: fit-content;
+ gap: 16px;
+ }
+
+ .comparing-two-revisions .revisions-meta .restore-revision {
+ margin-top: 16px;
+ }
+
+ .revisions-controls {
+ padding-top: 0;
+ }
+
+ .revision-toggle-compare-mode {
+ position: relative;
+ padding: 1rem 0;
+ }
+}
+
@media screen and (max-width: 782px) {
#diff-next-revision,
#diff-previous-revision {
@@ -585,14 +607,18 @@ div.revisions-controls > .wp-slider > .ui-slider-handle {
.revisions-controls,
.comparing-two-revisions .revisions-controls {
- height: 170px;
+ height: fit-content;
}
.revisions-tooltip {
- bottom: 130px;
+ bottom: 155px;
z-index: 2;
}
+ .comparing-two-revisions .revisions-tooltip {
+ bottom: 200px;
+ }
+
.diff-meta {
overflow: hidden;
}
diff --git a/src/wp-admin/edit-comments.php b/src/wp-admin/edit-comments.php
index 262e2d9c35..8a004b5226 100644
--- a/src/wp-admin/edit-comments.php
+++ b/src/wp-admin/edit-comments.php
@@ -439,7 +439,7 @@ if ( isset( $_REQUEST['approved'] )
<input type="hidden" name="p" value="<?php echo esc_attr( (int) $post_id ); ?>" />
<?php endif; ?>
<input type="hidden" name="comment_status" value="<?php echo esc_attr( $comment_status ); ?>" />
-<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr( current_time( 'mysql', 1 ) ); ?>" />
+<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr( current_time( 'mysql', true ) ); ?>" />
<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'total_items' ) ); ?>" />
<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'per_page' ) ); ?>" />
diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
index 83b682634b..53635479e0 100644
--- a/src/wp-admin/includes/ajax-actions.php
+++ b/src/wp-admin/includes/ajax-actions.php
@@ -5354,7 +5354,7 @@ function wp_ajax_health_check_dotorg_communication() {
_doing_it_wrong(
'wp_ajax_health_check_dotorg_communication',
sprintf(
- // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it.
+ /* translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. */
__( 'The Site Health check for %1$s has been replaced with %2$s.' ),
'wp_ajax_health_check_dotorg_communication',
'WP_REST_Site_Health_Controller::test_dotorg_communication'
@@ -5387,7 +5387,7 @@ function wp_ajax_health_check_background_updates() {
_doing_it_wrong(
'wp_ajax_health_check_background_updates',
sprintf(
- // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it.
+ /* translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. */
__( 'The Site Health check for %1$s has been replaced with %2$s.' ),
'wp_ajax_health_check_background_updates',
'WP_REST_Site_Health_Controller::test_background_updates'
@@ -5420,7 +5420,7 @@ function wp_ajax_health_check_loopback_requests() {
_doing_it_wrong(
'wp_ajax_health_check_loopback_requests',
sprintf(
- // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it.
+ /* translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. */
__( 'The Site Health check for %1$s has been replaced with %2$s.' ),
'wp_ajax_health_check_loopback_requests',
'WP_REST_Site_Health_Controller::test_loopback_requests'
@@ -5470,7 +5470,7 @@ function wp_ajax_health_check_get_sizes() {
_doing_it_wrong(
'wp_ajax_health_check_get_sizes',
sprintf(
- // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it.
+ /* translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. */
__( 'The Site Health check for %1$s has been replaced with %2$s.' ),
'wp_ajax_health_check_get_sizes',
'WP_REST_Site_Health_Controller::get_directory_sizes'
diff --git a/src/wp-admin/includes/class-custom-image-header.php b/src/wp-admin/includes/class-custom-image-header.php
index 54be1d90e4..3716b55909 100644
--- a/src/wp-admin/includes/class-custom-image-header.php
+++ b/src/wp-admin/includes/class-custom-image-header.php
@@ -951,7 +951,7 @@ endif;
<p class="submit">
<?php submit_button( __( 'Crop and Publish' ), 'primary', 'submit', false ); ?>
<?php
- if ( isset( $oitar ) && 1 === $oitar
+ if ( 1 === $oitar
&& ( current_theme_supports( 'custom-header', 'flex-height' )
|| current_theme_supports( 'custom-header', 'flex-width' ) )
) {
diff --git a/src/wp-admin/includes/class-language-pack-upgrader.php b/src/wp-admin/includes/class-language-pack-upgrader.php
index 6f7cf742bd..89b9f9ac87 100644
--- a/src/wp-admin/includes/class-language-pack-upgrader.php
+++ b/src/wp-admin/includes/class-language-pack-upgrader.php
@@ -383,7 +383,7 @@ class Language_Pack_Upgrader extends WP_Upgrader {
case 'theme':
$theme = wp_get_theme( $update->slug );
if ( $theme->exists() ) {
- return $theme->Get( 'Name' );
+ return $theme->get( 'Name' );
}
break;
case 'plugin':
diff --git a/src/wp-admin/includes/class-wp-automatic-updater.php b/src/wp-admin/includes/class-wp-automatic-updater.php
index 4dccd94ccd..2facbeb1d5 100644
--- a/src/wp-admin/includes/class-wp-automatic-updater.php
+++ b/src/wp-admin/includes/class-wp-automatic-updater.php
@@ -411,7 +411,7 @@ class WP_Automatic_Updater {
case 'theme':
$upgrader_item = $item->theme;
$theme = wp_get_theme( $upgrader_item );
- $item_name = $theme->Get( 'Name' );
+ $item_name = $theme->get( 'Name' );
// Add the current version so that it can be reported in the notification email.
$item->current_version = $theme->get( 'Version' );
if ( empty( $item->current_version ) ) {
diff --git a/src/wp-admin/includes/class-wp-community-events.php b/src/wp-admin/includes/class-wp-community-events.php
index 008611af21..b5a65e298d 100644
--- a/src/wp-admin/includes/class-wp-community-events.php
+++ b/src/wp-admin/includes/class-wp-community-events.php
@@ -375,17 +375,13 @@ class WP_Community_Events {
* of the user who triggered the cache refresh, rather than their own.
*
* @since 4.8.0
- * @deprecated 5.6.0 No longer used in core.
+ * @deprecated 5.5.2 No longer used in core.
*
* @param array $response_body The response which contains the events.
* @return array The response with dates and times formatted.
*/
protected function format_event_data_time( $response_body ) {
- _deprecated_function(
- __METHOD__,
- '5.5.2',
- 'This is no longer used by core, and only kept for backward compatibility.'
- );
+ _deprecated_function( __METHOD__, '5.5.2' );
if ( isset( $response_body['events'] ) ) {
foreach ( $response_body['events'] as $key => $event ) {
diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php
index cbb57a4b8c..cd04297684 100644
--- a/src/wp-admin/includes/class-wp-debug-data.php
+++ b/src/wp-admin/includes/class-wp-debug-data.php
@@ -682,6 +682,25 @@ class WP_Debug_Data {
);
}
+ // Get the image format transforms.
+ $mappings = wp_get_image_editor_output_format( '', '' );
+ $formatted_mappings = array();
+
+ if ( ! empty( $mappings ) ) {
+ foreach ( $mappings as $format => $mime_type ) {
+ $formatted_mappings[] = sprintf( '%s &rarr; %s', $format, $mime_type );
+ }
+ $mappings_display = implode( ', ', $formatted_mappings );
+ } else {
+ $mappings_display = __( 'No format transforms defined' );
+ }
+
+ $fields['image_format_transforms'] = array(
+ 'label' => __( 'Image format transforms' ),
+ 'value' => $mappings_display,
+ 'debug' => ( empty( $mappings ) ) ? 'No format transforms defined' : $mappings_display,
+ );
+
// Get GD information, if available.
if ( function_exists( 'gd_info' ) ) {
$gd = gd_info();
@@ -1860,10 +1879,14 @@ class WP_Debug_Data {
* Intended to supplement the array returned by `WP_Debug_Data::debug_data()`.
*
* @since 5.2.0
+ * @deprecated 5.6.0 Use WP_REST_Site_Health_Controller::get_directory_sizes()
+ * @see WP_REST_Site_Health_Controller::get_directory_sizes()
*
* @return array The sizes of the directories, also the database size and total installation size.
*/
public static function get_sizes() {
+ _deprecated_function( __METHOD__, '5.6.0', 'WP_REST_Site_Health_Controller::get_directory_sizes()' );
+
$size_db = self::get_database_size();
$upload_dir = wp_get_upload_dir();
diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpext.php b/src/wp-admin/includes/class-wp-filesystem-ftpext.php
index 0294720ccd..7c721734c3 100644
--- a/src/wp-admin/includes/class-wp-filesystem-ftpext.php
+++ b/src/wp-admin/includes/class-wp-filesystem-ftpext.php
@@ -601,9 +601,11 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
}
/**
- * @param string $line
- * @return array {
- * Array of file information.
+ * Parses an individual entry from the FTP LIST command output.
+ *
+ * @param string $line A line from the directory listing.
+ * @return array|string {
+ * Array of file information. Empty string if the line could not be parsed.
*
* @type string $name Name of the file or directory.
* @type string $perms *nix representation of permissions.
@@ -658,7 +660,6 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
$lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY );
if ( $lucifer ) {
- // echo $line."\n";
$lcount = count( $lucifer );
if ( $lcount < 8 ) {
diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
index 9a37d88c11..986fccf2cf 100644
--- a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
+++ b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
@@ -77,7 +77,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
return false;
}
- $this->ftp->setTimeout( FS_CONNECT_TIMEOUT );
+ $this->ftp->SetTimeout( FS_CONNECT_TIMEOUT );
if ( ! $this->ftp->SetServer( $this->options['hostname'], $this->options['port'] ) ) {
$this->errors->add(
@@ -120,7 +120,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
$this->ftp->SetType( FTP_BINARY );
$this->ftp->Passive( true );
- $this->ftp->setTimeout( FS_TIMEOUT );
+ $this->ftp->SetTimeout( FS_TIMEOUT );
return true;
}
diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
index 5a7fa0db8e..cdf31db597 100644
--- a/src/wp-admin/includes/class-wp-list-table.php
+++ b/src/wp-admin/includes/class-wp-list-table.php
@@ -72,10 +72,10 @@ class WP_List_Table {
protected $modes = array();
/**
- * Stores the value returned by ->get_column_info().
+ * Stores the value returned by ::get_column_info().
*
* @since 4.1.0
- * @var array
+ * @var array|null
*/
protected $_column_headers;
diff --git a/src/wp-admin/includes/class-wp-ms-sites-list-table.php b/src/wp-admin/includes/class-wp-ms-sites-list-table.php
index 01968869a1..6097f5e13e 100644
--- a/src/wp-admin/includes/class-wp-ms-sites-list-table.php
+++ b/src/wp-admin/includes/class-wp-ms-sites-list-table.php
@@ -37,7 +37,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
$this->status_list = array(
'archived' => array( 'site-archived', __( 'Archived' ) ),
'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ),
- 'deleted' => array( 'site-deleted', __( 'Deleted' ) ),
+ 'deleted' => array( 'site-deleted', __( 'Flagged for Deletion' ) ),
'mature' => array( 'site-mature', __( 'Mature' ) ),
);
@@ -256,8 +256,8 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
/* translators: %s: Number of sites. */
'deleted' => _n_noop(
- 'Deleted <span class="count">(%s)</span>',
- 'Deleted <span class="count">(%s)</span>'
+ 'Flagged for Deletion <span class="count">(%s)</span>',
+ 'Flagged for Deletion <span class="count">(%s)</span>'
),
);
@@ -667,7 +667,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
* @since 5.3.0
*
* @param string[] $site_states An array of site states. Default 'Main',
- * 'Archived', 'Mature', 'Spam', 'Deleted'.
+ * 'Archived', 'Mature', 'Spam', 'Flagged for Deletion'.
* @param WP_Site $site The current site object.
*/
$site_states = apply_filters( 'display_site_states', $site_states, $_site );
@@ -758,7 +758,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
'activateblog_' . $blog['blog_id']
)
),
- _x( 'Activate', 'site' )
+ _x( 'Remove Deletion Flag', 'site' )
);
} else {
$actions['deactivate'] = sprintf(
@@ -769,7 +769,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
'deactivateblog_' . $blog['blog_id']
)
),
- __( 'Deactivate' )
+ __( 'Flag for Deletion' )
);
}
@@ -830,7 +830,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
'deleteblog_' . $blog['blog_id']
)
),
- __( 'Delete' )
+ __( 'Delete Permanently' )
);
}
}
@@ -844,9 +844,9 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
/**
* Filters the action links displayed for each site in the Sites list table.
*
- * The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by
+ * The 'Edit', 'Dashboard', 'Delete Permanently', and 'Visit' links are displayed by
* default for each site. The site's status determines whether to show the
- * 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and
+ * 'Remove Deletion Flag' or 'Flag for Deletion' link, 'Unarchive' or 'Archive' links, and
* 'Not Spam' or 'Spam' link for each site.
*
* @since 3.1.0
diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php
index afcbfcb6f9..b7847d5e31 100644
--- a/src/wp-admin/includes/class-wp-site-health.php
+++ b/src/wp-admin/includes/class-wp-site-health.php
@@ -18,7 +18,7 @@ class WP_Site_Health {
private $mysql_server_version = '';
private $mysql_required_version = '5.5';
private $mysql_recommended_version = '8.0';
- private $mariadb_recommended_version = '10.5';
+ private $mariadb_recommended_version = '10.6';
public $php_memory_limit;
diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index 40059273ba..0658662126 100644
--- a/src/wp-admin/includes/file.php
+++ b/src/wp-admin/includes/file.php
@@ -2622,7 +2622,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
<?php
if ( isset( $types['ssh'] ) ) {
$hidden_class = '';
- if ( 'ssh' !== $connection_type || empty( $connection_type ) ) {
+ if ( 'ssh' !== $connection_type ) {
$hidden_class = ' class="hidden"';
}
?>
diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index 5c0b5d0b38..7d9fd638fb 100644
--- a/src/wp-admin/includes/media.php
+++ b/src/wp-admin/includes/media.php
@@ -3337,7 +3337,7 @@ function attachment_submitbox_metadata() {
$uploaded_by_link = get_edit_user_link( $author->ID );
}
?>
- <div class="misc-pub-section misc-pub-uploadedby">
+ <div class="misc-pub-section misc-pub-uploadedby word-wrap-break-word">
<?php if ( $uploaded_by_link ) { ?>
<?php _e( 'Uploaded by:' ); ?> <a href="<?php echo $uploaded_by_link; ?>"><strong><?php echo $uploaded_by_name; ?></strong></a>
<?php } else { ?>
diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php
index 979d237448..f42c247fb2 100644
--- a/src/wp-admin/includes/misc.php
+++ b/src/wp-admin/includes/misc.php
@@ -263,7 +263,7 @@ function save_mod_rewrite_rules() {
global $wp_rewrite;
if ( is_multisite() ) {
- return;
+ return null;
}
// Ensure get_home_path() is declared.
@@ -303,7 +303,7 @@ function iis7_save_url_rewrite_rules() {
global $wp_rewrite;
if ( is_multisite() ) {
- return;
+ return null;
}
// Ensure get_home_path() is declared.
@@ -988,7 +988,7 @@ function saveDomDocument( $doc, $filename ) { // phpcs:ignore WordPress.NamingCo
}
/**
- * Displays the default admin color scheme picker (Used in user-edit.php).
+ * Displays the default administration color scheme picker (Used in user-edit.php).
*
* @since 3.0.0
*
@@ -1025,7 +1025,7 @@ function admin_color_scheme_picker( $user_id ) {
<legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
- _e( 'Admin Color Scheme' );
+ _e( 'Administration Color Scheme' );
?>
</span></legend>
<?php
diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php
index 40fac43d6e..ebdd61df34 100644
--- a/src/wp-admin/includes/post.php
+++ b/src/wp-admin/includes/post.php
@@ -2186,7 +2186,7 @@ function wp_autosave( $post_data ) {
*
* @param int $post_id Optional. Post ID.
*/
-function redirect_post( $post_id = '' ) {
+function redirect_post( $post_id = 0 ) {
if ( isset( $_POST['save'] ) || isset( $_POST['publish'] ) ) {
$status = get_post_status( $post_id );
diff --git a/src/wp-admin/includes/revision.php b/src/wp-admin/includes/revision.php
index df7201e958..ec2460c0ca 100644
--- a/src/wp-admin/includes/revision.php
+++ b/src/wp-admin/includes/revision.php
@@ -407,41 +407,43 @@ function wp_print_revision_templates() {
<strong id="diff-title-to"><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
<# } #>
<div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>">
- {{{ data.attributes.author.avatar }}}
- <div class="author-info" id="diff-title-author">
- <# if ( data.attributes.autosave ) { #>
- <span class="byline">
- <?php
- printf(
- /* translators: %s: User's display name. */
- __( 'Autosave by %s' ),
- '<span class="author-name">{{ data.attributes.author.name }}</span>'
- );
- ?>
- </span>
- <# } else if ( data.attributes.current ) { #>
- <span class="byline">
- <?php
- printf(
- /* translators: %s: User's display name. */
- __( 'Current Revision by %s' ),
- '<span class="author-name">{{ data.attributes.author.name }}</span>'
- );
- ?>
- </span>
- <# } else { #>
- <span class="byline">
- <?php
- printf(
- /* translators: %s: User's display name. */
- __( 'Revision by %s' ),
- '<span class="author-name">{{ data.attributes.author.name }}</span>'
- );
- ?>
- </span>
- <# } #>
- <span class="time-ago">{{ data.attributes.timeAgo }}</span>
- <span class="date">({{ data.attributes.dateShort }})</span>
+ <div>
+ {{{ data.attributes.author.avatar }}}
+ <div class="author-info" id="diff-title-author">
+ <# if ( data.attributes.autosave ) { #>
+ <span class="byline">
+ <?php
+ printf(
+ /* translators: %s: User's display name. */
+ __( 'Autosave by %s' ),
+ '<span class="author-name">{{ data.attributes.author.name }}</span>'
+ );
+ ?>
+ </span>
+ <# } else if ( data.attributes.current ) { #>
+ <span class="byline">
+ <?php
+ printf(
+ /* translators: %s: User's display name. */
+ __( 'Current Revision by %s' ),
+ '<span class="author-name">{{ data.attributes.author.name }}</span>'
+ );
+ ?>
+ </span>
+ <# } else { #>
+ <span class="byline">
+ <?php
+ printf(
+ /* translators: %s: User's display name. */
+ __( 'Revision by %s' ),
+ '<span class="author-name">{{ data.attributes.author.name }}</span>'
+ );
+ ?>
+ </span>
+ <# } #>
+ <span class="time-ago">{{ data.attributes.timeAgo }}</span>
+ <span class="date">({{ data.attributes.dateShort }})</span>
+ </div>
</div>
<# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
<input <?php if ( wp_check_post_lock( $post->ID ) ) { ?>
diff --git a/src/wp-admin/includes/taxonomy.php b/src/wp-admin/includes/taxonomy.php
index 7765084fa7..359cfafe2f 100644
--- a/src/wp-admin/includes/taxonomy.php
+++ b/src/wp-admin/includes/taxonomy.php
@@ -75,7 +75,7 @@ function wp_create_category( $cat_name, $category_parent = 0 ) {
* @param int $post_id Optional. The post ID. Default empty.
* @return int[] Array of IDs of categories assigned to the given post.
*/
-function wp_create_categories( $categories, $post_id = '' ) {
+function wp_create_categories( $categories, $post_id = 0 ) {
$cat_ids = array();
foreach ( $categories as $category ) {
$id = category_exists( $category );
diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php
index 127027d8f5..16da3388ae 100644
--- a/src/wp-admin/includes/template.php
+++ b/src/wp-admin/includes/template.php
@@ -817,9 +817,6 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$tab_index_attribute = " tabindex=\"$tab_index\"";
}
- // @todo Remove this?
- // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
-
$post_date = ( $for_post ) ? $post->post_date : get_comment()->comment_date;
$jj = ( $edit ) ? mysql2date( 'd', $post_date, false ) : current_time( 'd' );
$mm = ( $edit ) ? mysql2date( 'm', $post_date, false ) : current_time( 'm' );
diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php
index f1731f9c8f..2d925afa63 100644
--- a/src/wp-admin/includes/update-core.php
+++ b/src/wp-admin/includes/update-core.php
@@ -1023,6 +1023,7 @@ $_new_bundled_files = array(
* @global string[] $_old_requests_files
* @global string[] $_new_bundled_files
* @global wpdb $wpdb WordPress database abstraction object.
+ * @global string $wp_version The WordPress version string.
*
* @param string $from New release unzipped path.
* @param string $to Path to old WordPress installation.
diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
index d8d3248edb..a3c7260a04 100644
--- a/src/wp-admin/includes/upgrade.php
+++ b/src/wp-admin/includes/upgrade.php
@@ -208,7 +208,7 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
// First post.
$now = current_time( 'mysql' );
- $now_gmt = current_time( 'mysql', 1 );
+ $now_gmt = current_time( 'mysql', true );
$first_post_guid = get_option( 'home' ) . '/?p=1';
if ( is_multisite() ) {
diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php
index 736c5138e9..13ebf730bd 100644
--- a/src/wp-admin/install.php
+++ b/src/wp-admin/install.php
@@ -233,9 +233,9 @@ if ( is_blog_installed() ) {
/**
* @global string $wp_version The WordPress version string.
- * @global string $required_php_version The required PHP version string.
+ * @global string $required_php_version The minimum required PHP version string.
* @global string[] $required_php_extensions The names of required PHP extensions.
- * @global string $required_mysql_version The required MySQL version string.
+ * @global string $required_mysql_version The minimum required MySQL version string.
* @global wpdb $wpdb WordPress database abstraction object.
*/
global $wp_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wpdb;
diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php
index 82136429ba..e4f92b38ba 100644
--- a/src/wp-admin/menu.php
+++ b/src/wp-admin/menu.php
@@ -378,7 +378,7 @@ $menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php',
$submenu['tools.php'][20] = array( sprintf( __( 'Site Health %s' ), $site_health_count ), 'view_site_health_checks', 'site-health.php' );
$submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' );
$submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' );
-if ( is_multisite() && ! is_main_site() ) {
+if ( is_multisite() && ! is_main_site() && '1' !== get_site()->deleted ) {
$submenu['tools.php'][35] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
}
if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
diff --git a/src/wp-admin/nav-menus.php b/src/wp-admin/nav-menus.php
index 36905bab63..82c8e264ad 100644
--- a/src/wp-admin/nav-menus.php
+++ b/src/wp-admin/nav-menus.php
@@ -1083,7 +1083,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
$menu_name_aria_desc = $add_new_screen ? ' aria-describedby="menu-name-desc"' : '';
if ( $one_theme_location_no_menus ) {
- $menu_name_val = 'value="' . esc_attr( 'Menu 1' ) . '"';
+ $menu_name_val = 'value="' . esc_attr__( 'Menu 1' ) . '"';
?>
<input type="hidden" name="zero-menu-state" value="true" />
<?php
diff --git a/src/wp-admin/network/site-info.php b/src/wp-admin/network/site-info.php
index 46f67cced5..a2a86a34e1 100644
--- a/src/wp-admin/network/site-info.php
+++ b/src/wp-admin/network/site-info.php
@@ -200,7 +200,7 @@ if ( ! empty( $messages ) ) {
if ( ! $is_main_site ) {
$attribute_fields['archived'] = __( 'Archived' );
$attribute_fields['spam'] = _x( 'Spam', 'site' );
- $attribute_fields['deleted'] = __( 'Deleted' );
+ $attribute_fields['deleted'] = __( 'Flagged for Deletion' );
}
$attribute_fields['mature'] = __( 'Mature' );
?>
diff --git a/src/wp-admin/network/site-new.php b/src/wp-admin/network/site-new.php
index a3b0919155..d1b0576113 100644
--- a/src/wp-admin/network/site-new.php
+++ b/src/wp-admin/network/site-new.php
@@ -204,7 +204,7 @@ if ( ! empty( $messages ) ) {
}
?>
<p><?php echo wp_required_field_message(); ?></p>
-<form method="post" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate">
+<form method="post" enctype="multipart/form-data" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate">
<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
<table class="form-table" role="presentation">
<tr class="form-field form-required">
diff --git a/src/wp-admin/network/sites.php b/src/wp-admin/network/sites.php
index 69ee15d95c..17a072287d 100644
--- a/src/wp-admin/network/sites.php
+++ b/src/wp-admin/network/sites.php
@@ -33,8 +33,8 @@ get_current_screen()->add_help_tab(
'<p>' . __( 'Hovering over each site reveals seven options (three for the primary site):' ) . '</p>' .
'<ul><li>' . __( 'An Edit link to a separate Edit Site screen.' ) . '</li>' .
'<li>' . __( 'Dashboard leads to the Dashboard for that site.' ) . '</li>' .
- '<li>' . __( 'Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.' ) . '</li>' .
- '<li>' . __( 'Delete which is a permanent action after the confirmation screen.' ) . '</li>' .
+ '<li>' . __( 'Flag for Deletion, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.' ) . '</li>' .
+ '<li>' . __( 'Delete Permanently which is a permanent action after the confirmation screen.' ) . '</li>' .
'<li>' . __( 'Visit to go to the front-end of the live site.' ) . '</li></ul>',
)
);
@@ -61,9 +61,9 @@ if ( isset( $_GET['action'] ) ) {
// A list of valid actions and their associated messaging for confirmation output.
$manage_actions = array(
/* translators: %s: Site URL. */
- 'activateblog' => __( 'You are about to activate the site %s.' ),
+ 'activateblog' => __( 'You are about to remove the deletion flag from the site %s.' ),
/* translators: %s: Site URL. */
- 'deactivateblog' => __( 'You are about to deactivate the site %s.' ),
+ 'deactivateblog' => __( 'You are about to flag the site %s for deletion.' ),
/* translators: %s: Site URL. */
'unarchiveblog' => __( 'You are about to unarchive the site %s.' ),
/* translators: %s: Site URL. */
@@ -106,6 +106,7 @@ if ( isset( $_GET['action'] ) ) {
$site_details = get_site( $id );
$site_address = untrailingslashit( $site_details->domain . $site_details->path );
+ $submit = __( 'Confirm' );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
@@ -124,8 +125,18 @@ if ( isset( $_GET['action'] ) ) {
<p><?php _e( 'Deleting a site is a permanent action that cannot be undone. This will delete the entire site and its uploads directory.' ); ?>
</div>
<?php
- } else {
- $submit = __( 'Confirm' );
+ } elseif ( 'archiveblog' === $site_action ) {
+ ?>
+ <div class="notice notice-warning inline">
+ <p><?php _e( 'Archiving a site makes the site unavailable to its users and visitors. This is a reversible action.' ); ?>
+ </div>
+ <?php
+ } elseif ( 'deactivateblog' === $site_action ) {
+ ?>
+ <div class="notice notice-warning inline">
+ <p><?php _e( 'Flagging a site for deletion makes the site unavailable to its users and visitors. This is a reversible action. A super admin can permanently delete the site at a later date.' ); ?>
+ </div>
+ <?php
}
?>
<p><?php printf( $manage_actions[ $site_action ], "<strong>{$site_address}</strong>" ); ?></p>
@@ -205,6 +216,9 @@ if ( isset( $_GET['action'] ) ) {
<input type="hidden" name="action" value="delete_sites" />
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
<?php wp_nonce_field( 'ms-delete-sites', '_wpnonce', false ); ?>
+ <div class="notice notice-warning inline">
+ <p><?php _e( 'Deleting a site is a permanent action that cannot be undone. This will delete the entire site and its uploads directory.' ); ?>
+ </div>
<p><?php _e( 'You are about to delete the following sites:' ); ?></p>
<ul class="ul-disc">
<?php
@@ -220,7 +234,7 @@ if ( isset( $_GET['action'] ) ) {
</li>
<?php endforeach; ?>
</ul>
- <?php submit_button( __( 'Confirm' ), 'primary' ); ?>
+ <?php submit_button( __( 'Delete these sites permanently' ), 'primary' ); ?>
</form>
</div>
<?php
@@ -271,22 +285,22 @@ if ( isset( $_GET['action'] ) ) {
update_blog_status( $id, 'deleted', '0' );
/**
- * Fires after a network site is activated.
+ * Fires after a network site has its deletion flag removed.
*
* @since MU (3.0.0)
*
- * @param int $id The ID of the activated site.
+ * @param int $id The ID of the reactivated site.
*/
do_action( 'activate_blog', $id );
break;
case 'deactivateblog':
/**
- * Fires before a network site is deactivated.
+ * Fires before a network site is flagged for deletion.
*
* @since MU (3.0.0)
*
- * @param int $id The ID of the site being deactivated.
+ * @param int $id The ID of the site being flagged for deletion.
*/
do_action( 'deactivate_blog', $id );
@@ -326,10 +340,10 @@ if ( isset( $_GET['updated'] ) ) {
$msg = __( 'Sites marked as spam.' );
break;
case 'all_delete':
- $msg = __( 'Sites deleted.' );
+ $msg = __( 'Sites permanently deleted.' );
break;
case 'delete':
- $msg = __( 'Site deleted.' );
+ $msg = __( 'Site permanently deleted.' );
break;
case 'not_deleted':
$msg = __( 'Sorry, you are not allowed to delete that site.' );
@@ -341,10 +355,10 @@ if ( isset( $_GET['updated'] ) ) {
$msg = __( 'Site unarchived.' );
break;
case 'activateblog':
- $msg = __( 'Site activated.' );
+ $msg = __( 'Site deletion flag removed.' );
break;
case 'deactivateblog':
- $msg = __( 'Site deactivated.' );
+ $msg = __( 'Site flagged for deletion.' );
break;
case 'unspamblog':
$msg = __( 'Site removed from spam.' );
diff --git a/src/wp-admin/options-discussion.php b/src/wp-admin/options-discussion.php
index 6bb8ce2f54..e0e12dc21f 100644
--- a/src/wp-admin/options-discussion.php
+++ b/src/wp-admin/options-discussion.php
@@ -309,6 +309,8 @@ $avatar_defaults = array(
'monsterid' => __( 'MonsterID (Generated)' ),
'retro' => __( 'Retro (Generated)' ),
'robohash' => __( 'RoboHash (Generated)' ),
+ 'initials' => __( 'Initials (Generated)' ),
+ 'color' => __( 'Color (Generated)' ),
);
/**
* Filters the default avatars.
diff --git a/src/wp-admin/options.php b/src/wp-admin/options.php
index 8348b24c8e..23d0f3971b 100644
--- a/src/wp-admin/options.php
+++ b/src/wp-admin/options.php
@@ -404,21 +404,32 @@ foreach ( (array) $options as $option ) :
continue;
}
+ if ( 'home' === $option->option_name && defined( 'WP_HOME' ) ) {
+ $disabled = true;
+ }
+
+ if ( 'siteurl' === $option->option_name && defined( 'WP_SITEURL' ) ) {
+ $disabled = true;
+ }
+
if ( is_serialized( $option->option_value ) ) {
if ( is_serialized_string( $option->option_value ) ) {
// This is a serialized string, so we should display it.
$value = maybe_unserialize( $option->option_value );
$options_to_update[] = $option->option_name;
- $class = 'all-options';
} else {
$value = 'SERIALIZED DATA';
$disabled = true;
- $class = 'all-options disabled';
}
} else {
$value = $option->option_value;
$options_to_update[] = $option->option_name;
- $class = 'all-options';
+ }
+
+ $class = 'all-options';
+
+ if ( $disabled ) {
+ $class .= ' disabled';
}
$name = esc_attr( $option->option_name );
diff --git a/src/wp-admin/post.php b/src/wp-admin/post.php
index 1b8214c9ce..468041c9ea 100644
--- a/src/wp-admin/post.php
+++ b/src/wp-admin/post.php
@@ -160,7 +160,7 @@ switch ( $action ) {
$submenu_file = 'upload.php';
$post_new_file = 'media-new.php';
} else {
- if ( isset( $post_type_object ) && $post_type_object->show_in_menu && true !== $post_type_object->show_in_menu ) {
+ if ( $post_type_object->show_in_menu && true !== $post_type_object->show_in_menu ) {
$parent_file = $post_type_object->show_in_menu;
} else {
$parent_file = "edit.php?post_type=$post_type";
diff --git a/src/wp-admin/upgrade.php b/src/wp-admin/upgrade.php
index ea98082704..f0c9cbbdfd 100644
--- a/src/wp-admin/upgrade.php
+++ b/src/wp-admin/upgrade.php
@@ -37,9 +37,9 @@ if ( 'upgrade_db' === $step ) {
/**
* @global string $wp_version The WordPress version string.
- * @global string $required_php_version The required PHP version string.
+ * @global string $required_php_version The minimum required PHP version string.
* @global string[] $required_php_extensions The names of required PHP extensions.
- * @global string $required_mysql_version The required MySQL version string.
+ * @global string $required_mysql_version The minimum required MySQL version string.
* @global wpdb $wpdb WordPress database abstraction object.
*/
global $wp_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wpdb;
diff --git a/src/wp-admin/user-edit.php b/src/wp-admin/user-edit.php
index c476a294ad..6810425c77 100644
--- a/src/wp-admin/user-edit.php
+++ b/src/wp-admin/user-edit.php
@@ -333,11 +333,11 @@ switch ( $action ) {
<?php if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
<tr class="user-admin-color-wrap">
- <th scope="row"><?php _e( 'Admin Color Scheme' ); ?></th>
+ <th scope="row"><?php _e( 'Administration Color Scheme' ); ?></th>
<td>
<?php
/**
- * Fires in the 'Admin Color Scheme' section of the user editing screen.
+ * Fires in the 'Administration Color Scheme' section of the user editing screen.
*
* The section is only enabled if a callback is hooked to the action,
* and if there is more than one defined color scheme for the admin.
@@ -486,17 +486,35 @@ switch ( $action ) {
<tr class="user-first-name-wrap">
<th><label for="first_name"><?php _e( 'First Name' ); ?></label></th>
- <td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profile_user->first_name ); ?>" class="regular-text" /></td>
+ <td>
+ <?php if ( IS_PROFILE_PAGE ) : ?>
+ <input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profile_user->first_name ); ?>" autocomplete="given-name" class="regular-text" />
+ <?php else : ?>
+ <input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profile_user->first_name ); ?>" class="regular-text" />
+ <?php endif; ?>
+ </td>
</tr>
<tr class="user-last-name-wrap">
<th><label for="last_name"><?php _e( 'Last Name' ); ?></label></th>
- <td><input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profile_user->last_name ); ?>" class="regular-text" /></td>
+ <td>
+ <?php if ( IS_PROFILE_PAGE ) : ?>
+ <input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profile_user->last_name ); ?>" autocomplete="family-name" class="regular-text" />
+ <?php else : ?>
+ <input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profile_user->last_name ); ?>" class="regular-text" />
+ <?php endif; ?>
+ </td>
</tr>
<tr class="user-nickname-wrap">
<th><label for="nickname"><?php _e( 'Nickname' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
- <td><input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profile_user->nickname ); ?>" class="regular-text" /></td>
+ <td>
+ <?php if ( IS_PROFILE_PAGE ) : ?>
+ <input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profile_user->nickname ); ?>" autocomplete="nickname" class="regular-text" />
+ <?php else : ?>
+ <input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profile_user->nickname ); ?>" class="regular-text" />
+ <?php endif; ?>
+ </td>
</tr>
<tr class="user-display-name-wrap">
@@ -546,7 +564,7 @@ switch ( $action ) {
<th><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
<td>
<?php if ( $profile_user->ID === $current_user->ID ) : ?>
- <input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profile_user->user_email ); ?>" class="regular-text ltr" />
+ <input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profile_user->user_email ); ?>" autocomplete="email" class="regular-text ltr" />
<p class="description" id="email-description">
<?php _e( 'If you change this, an email will be sent at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>
</p>