From 725d3043d5188e6f129b3d525940cad19711843d Mon Sep 17 00:00:00 2001
From: Tony Volpe
+ Version %1$s addressed %2$s bug.',
+ 'Version %1$s addressed %2$s bugs.',
+ 10
+ ),
+ '6.4.1',
+ '4'
+ );
+ ?>
+ the release notes.' ),
+ sprintf(
+ /* translators: %s: WordPress version. */
+ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
+ sanitize_title( '6.4.1' )
+ )
+ );
+ ?>
+
-
+
+
+ Twenty Twenty-Four. Built with three distinct use cases in mind, the versatility of the new default theme makes it an ideal choice for almost any type of website. Dive into its collection of templates and patterns and unlock a world of creative possibilities with just a few tweaks.' ),
+ __( 'https://make.wordpress.org/core/2023/08/24/introducing-twenty-twenty-four/' )
+ );
+ ?>
+
+ a refreshed design and more commands to find what you\'re looking for, perform tasks efficiently, and save time as you create.' ),
+ __( 'https://make.wordpress.org/core/2023/09/12/core-editor-improvement-commanding-the-command-palette/' )
+ );
+ ?>
+
+ New enhancements ensure your content creation journey is smooth. Find new keyboard shortcuts in List View, refined list merging, and enhanced control over link settings. A revamped and cohesive toolbar experience for Navigation, List, and Quote blocks lets you efficiently work with the tooling options you need.' ),
+ __( 'https://make.wordpress.org/core/2023/10/05/core-editor-improvement-ensuring-excellence-in-the-writing-experience/' )
+ );
+ ?>
WordPress Field Guide. It is overflowing with detailed developer notes to help you build with WordPress.' ),
- __( 'https://make.wordpress.org/core/2023/07/18/wordpress-6-3-field-guide/' )
+ __( 'Explore the WordPress %2$s Field Guide. Learn about the changes in this release with detailed developer notes to help you build with WordPress.' ),
+ __( 'https://make.wordpress.org/core/2023/10/23/wordpress-6-4-field-guide/' ),
+ '6.4'
);
?>
Read the WordPress %2$s Release Notes for more information on the included enhancements and issues fixed, installation information, developer notes and resources, release contributors, and the list of file changes in this release.' ),
+ __( 'Read the WordPress %2$s Release Notes for information on installation, enhancements, fixed issues, release contributors, learning resources, and the list of file changes.' ),
sprintf(
/* translators: %s: WordPress version number. */
esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ),
- '6-3'
+ '6-4'
),
- '6.3'
+ '6.4'
);
?>
get_error_message(); ?>
-
-
- ' . __( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ) . ' ' . $error_string . ' $msg->error $msg->error $msg->msg $msg->msg ' . sprintf(
diff --git a/wp/wp-admin/includes/menu.php b/wp/wp-admin/includes/menu.php
index ae8e06be..da1b2ebf 100644
--- a/wp/wp-admin/includes/menu.php
+++ b/wp/wp-admin/includes/menu.php
@@ -228,7 +228,7 @@ function add_menu_classes( $menu ) {
$i = 0;
foreach ( $menu as $order => $top ) {
- $i++;
+ ++$i;
if ( 0 === $order ) { // Dashboard is always shown/single.
$menu[0][4] = add_cssclass( 'menu-top-first', $top[4] );
diff --git a/wp/wp-admin/includes/meta-boxes.php b/wp/wp-admin/includes/meta-boxes.php
index 7d0e1def..52280760 100644
--- a/wp/wp-admin/includes/meta-boxes.php
+++ b/wp/wp-admin/includes/meta-boxes.php
@@ -311,25 +311,24 @@ function post_submit_meta_box( $post, $args = array() ) {
endif;
if ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) :
- ?>
-
- unpublished customization changes. You can edit, but there is no need to publish now. It will be published automatically with those changes.' ),
- esc_url(
- add_query_arg(
- 'changeset_uuid',
- rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ),
- admin_url( 'customize.php' )
- )
- )
- );
- ?>
-
@@ -1496,7 +1495,7 @@ function link_advanced_meta_box( $link ) {
link_rating ) && $link->link_rating == $rating ) {
+ if ( isset( $link->link_rating ) && $link->link_rating === $rating ) {
echo ' selected="selected"';
}
echo '>' . $rating . '';
diff --git a/wp/wp-admin/includes/misc.php b/wp/wp-admin/includes/misc.php
index 34ced18d..09028206 100644
--- a/wp/wp-admin/includes/misc.php
+++ b/wp/wp-admin/includes/misc.php
@@ -403,7 +403,7 @@ function wp_print_theme_file_tree( $tree, $level = 2, $size = 1, $index = 1 ) {
$size = count( $tree );
foreach ( $tree as $label => $theme_file ) :
- $index++;
+ ++$index;
if ( ! is_array( $theme_file ) ) {
wp_print_theme_file_tree( $theme_file, $level, $index, $size );
@@ -505,7 +505,7 @@ function wp_print_plugin_file_tree( $tree, $label = '', $level = 2, $size = 1, $
$size = count( $tree );
foreach ( $tree as $label => $plugin_file ) :
- $index++;
+ ++$index;
if ( ! is_array( $plugin_file ) ) {
wp_print_plugin_file_tree( $plugin_file, $label, $level, $index, $size );
diff --git a/wp/wp-admin/includes/ms.php b/wp/wp-admin/includes/ms.php
index c769375b..0d046665 100644
--- a/wp/wp-admin/includes/ms.php
+++ b/wp/wp-admin/includes/ms.php
@@ -58,14 +58,10 @@ function check_upload_size( $file ) {
* @since 3.0.0
* @since 5.1.0 Use wp_delete_site() internally to delete the site row from the database.
*
- * @global wpdb $wpdb WordPress database abstraction object.
- *
* @param int $blog_id Site ID.
* @param bool $drop True if site's database tables should be dropped. Default false.
*/
function wpmu_delete_blog( $blog_id, $drop = false ) {
- global $wpdb;
-
$blog_id = (int) $blog_id;
$switch = false;
@@ -696,11 +692,20 @@ function site_admin_notice() {
}
if ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $wp_db_version ) {
- echo " '
- . __( 'Click Save Menu to make pending menu items public.' )
- . ' '
- . __( 'There are some invalid menu items. Please check or delete them.' )
- . ' ' . __( 'Warning:' ) . ' ' . sprintf(
- /* translators: %s: URL to Plugins screen. */
- __( 'Please deactivate your plugins before enabling the Network feature.' ),
- admin_url( 'plugins.php?plugin_status=active' )
- ) . ' ' . __( 'Once the network is created, you may reactivate your plugins.' ) . ' ' . __( 'Error:' ) . ' ' . __( 'You cannot install a network of sites with your server address.' ) . ' ' . sprintf(
/* translators: %s: Port number. */
__( 'You cannot use port numbers such as %s.' ),
@@ -157,11 +175,17 @@ function network_step1( $errors = false ) {
$error_codes = array();
if ( is_wp_error( $errors ) ) {
- echo ' ' . __( 'Error: The network could not be created.' ) . ' ' . __( 'Error: The network could not be created.' ) . ' $error $error ' . __( 'Note:' ) . ' ';
- printf(
+ $message_class = 'updated';
+ $message = ' ' . __( 'Warning:' ) . ' ';
+ $message .= ' ' . sprintf(
/* translators: %s: mod_rewrite */
__( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ),
' ' . __( 'Warning:' ) . ' ';
- printf(
+ $message_class = 'error';
+ $message = ' ' . __( 'Warning:' ) . ' ';
+ $message .= sprintf(
/* translators: %s: mod_rewrite */
__( 'It looks like the Apache %s module is not installed.' ),
' ';
- printf(
+ $message .= ' ' . sprintf(
/* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite. */
__( 'If %1$s is disabled, ask your administrator to enable that module, or look at the Apache documentation or elsewhere for help setting it up.' ),
' ' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '
' . __( 'Caution:' ) . ' ';
+ $notice_args = array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'inline' ),
+ );
+
if ( file_exists( $home_path . '.htaccess' ) ) {
- echo '' . __( 'Caution:' ) . ' ';
- printf(
+ $notice_message .= sprintf(
/* translators: 1: wp-config.php, 2: .htaccess */
__( 'You should back up your existing %1$s and %2$s files.' ),
' ';
- _e( 'Error: This plugin requires a newer version of PHP.' );
+ $compatible_php_notice_message = ' ';
+ $compatible_php_notice_message .= __( 'Error: This plugin requires a newer version of PHP.' );
+
if ( current_user_can( 'update_php' ) ) {
- printf(
+ $compatible_php_notice_message .= sprintf(
/* translators: %s: URL to Update PHP page. */
' ' . __( 'Click here to learn more about updating PHP.' ),
esc_url( wp_get_update_php_url() )
- );
-
- wp_update_php_annotation( ' ', '' );
+ ) . wp_update_php_annotation( ' ', '', false );
} else {
- echo ' ';
- _e( 'Warning: This plugin has not been tested with your current version of WordPress.' );
- echo ' ';
- _e( 'Error: This plugin requires a newer version of WordPress.' );
+ $compatible_wp_notice_message = __( 'Error: This plugin requires a newer version of WordPress.' );
if ( current_user_can( 'update_core' ) ) {
- printf(
+ $compatible_wp_notice_message .= sprintf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( 'Click here to update WordPress.' ),
esc_url( self_admin_url( 'update-core.php' ) )
);
}
- echo ' %s %s',
__( 'One or more plugins failed to load properly.' ),
__( 'You can find more details and make changes on the Plugins screen.' ),
esc_url( admin_url( 'plugins.php?plugin_status=paused' ) ),
__( 'Go to the Plugins screen' )
);
+ wp_admin_notice(
+ $message,
+ array( 'type' => 'error' )
+ );
}
/**
@@ -2571,8 +2575,8 @@ function deactivated_plugins_notice() {
);
}
- printf(
- ' %s %s',
sprintf(
/* translators: %s: Name of deactivated plugin. */
__( '%s plugin deactivated during WordPress upgrade.' ),
@@ -2582,6 +2586,7 @@ function deactivated_plugins_notice() {
esc_url( admin_url( 'plugins.php?plugin_status=inactive' ) ),
__( 'Go to the Plugins screen' )
);
+ wp_admin_notice( $message, array( 'type' => 'warning' ) );
}
// Empty the options.
diff --git a/wp/wp-admin/includes/post.php b/wp/wp-admin/includes/post.php
index ed73b8ff..b9986d1b 100644
--- a/wp/wp-admin/includes/post.php
+++ b/wp/wp-admin/includes/post.php
@@ -171,10 +171,6 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
}
}
- if ( isset( $post_data['edit_date'] ) && 'false' === $post_data['edit_date'] ) {
- $post_data['edit_date'] = false;
- }
-
if ( ! empty( $post_data['edit_date'] ) ) {
$aa = $post_data['aa'];
$mm = $post_data['mm'];
@@ -197,7 +193,19 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
return new WP_Error( 'invalid_date', __( 'Invalid date.' ) );
}
- $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
+ /*
+ * Only assign a post date if the user has explicitly set a new value.
+ * See #59125 and #19907.
+ */
+ $previous_date = $post_id ? get_post_field( 'post_date', $post_id ) : false;
+ if ( $previous_date && $previous_date !== $post_data['post_date'] ) {
+ $post_data['edit_date'] = true;
+ $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
+ } else {
+ $post_data['edit_date'] = false;
+ unset( $post_data['post_date'] );
+ unset( $post_data['post_date_gmt'] );
+ }
}
if ( isset( $post_data['post_category'] ) ) {
@@ -1957,11 +1965,12 @@ function wp_create_post_autosave( $post_data ) {
* Fires before an autosave is stored.
*
* @since 4.1.0
+ * @since 6.4.0 The `$is_update` parameter was added to indicate if the autosave is being updated or was newly created.
*
* @param array $new_autosave Post array - the autosave that is about to be saved.
+ * @param bool $is_update Whether this is an existing autosave.
*/
- do_action( 'wp_creating_autosave', $new_autosave );
-
+ do_action( 'wp_creating_autosave', $new_autosave, true );
return wp_update_post( $new_autosave );
}
@@ -1969,7 +1978,68 @@ function wp_create_post_autosave( $post_data ) {
$post_data = wp_unslash( $post_data );
// Otherwise create the new autosave as a special post revision.
- return _wp_put_post_revision( $post_data, true );
+ $revision = _wp_put_post_revision( $post_data, true );
+
+ if ( ! is_wp_error( $revision ) && 0 !== $revision ) {
+
+ /** This action is documented in wp-admin/includes/post.php */
+ do_action( 'wp_creating_autosave', get_post( $revision, ARRAY_A ), false );
+ }
+
+ return $revision;
+}
+
+/**
+ * Autosave the revisioned meta fields.
+ *
+ * Iterates through the revisioned meta fields and checks each to see if they are set,
+ * and have a changed value. If so, the meta value is saved and attached to the autosave.
+ *
+ * @since 6.4.0
+ *
+ * @param array $new_autosave The new post data being autosaved.
+ */
+function wp_autosave_post_revisioned_meta_fields( $new_autosave ) {
+ /*
+ * The post data arrives as either $_POST['data']['wp_autosave'] or the $_POST
+ * itself. This sets $posted_data to the correct variable.
+ *
+ * Ignoring sanitization to avoid altering meta. Ignoring the nonce check because
+ * this is hooked on inner core hooks where a valid nonce was already checked.
+ */
+ $posted_data = isset( $_POST['data']['wp_autosave'] ) ? $_POST['data']['wp_autosave'] : $_POST;
+
+ $post_type = get_post_type( $new_autosave['post_parent'] );
+
+ /*
+ * Go thru the revisioned meta keys and save them as part of the autosave, if
+ * the meta key is part of the posted data, the meta value is not blank and
+ * the the meta value has changes from the last autosaved value.
+ */
+ foreach ( wp_post_revision_meta_keys( $post_type ) as $meta_key ) {
+
+ if (
+ isset( $posted_data[ $meta_key ] ) &&
+ get_post_meta( $new_autosave['ID'], $meta_key, true ) !== wp_unslash( $posted_data[ $meta_key ] )
+ ) {
+ /*
+ * Use the underlying delete_metadata() and add_metadata() functions
+ * vs delete_post_meta() and add_post_meta() to make sure we're working
+ * with the actual revision meta.
+ */
+ delete_metadata( 'post', $new_autosave['ID'], $meta_key );
+
+ /*
+ * One last check to ensure meta value not empty().
+ */
+ if ( ! empty( $posted_data[ $meta_key ] ) ) {
+ /*
+ * Add the revisions meta data to the autosave.
+ */
+ add_metadata( 'post', $new_autosave['ID'], $meta_key, $posted_data[ $meta_key ] );
+ }
+ }
+ }
}
/**
@@ -2207,6 +2277,7 @@ function taxonomy_meta_box_sanitize_cb_input( $taxonomy, $terms ) {
*
* @since 5.0.0
* @since 6.3.0 Added `selectors` field.
+ * @since 6.4.0 Added `block_hooks` field.
*
* @return array An associative array of registered block data.
*/
@@ -2221,6 +2292,7 @@ function get_block_editor_server_block_settings() {
'attributes' => 'attributes',
'provides_context' => 'providesContext',
'uses_context' => 'usesContext',
+ 'block_hooks' => 'blockHooks',
'selectors' => 'selectors',
'supports' => 'supports',
'category' => 'category',
diff --git a/wp/wp-admin/includes/revision.php b/wp/wp-admin/includes/revision.php
index 530e2fde..8ed45fd1 100644
--- a/wp/wp-admin/includes/revision.php
+++ b/wp/wp-admin/includes/revision.php
@@ -161,7 +161,6 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
* @param WP_Post $compare_to The revision post to compare to.
*/
return apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );
-
}
/**
diff --git a/wp/wp-admin/includes/schema.php b/wp/wp-admin/includes/schema.php
index db91a628..d339af3b 100644
--- a/wp/wp-admin/includes/schema.php
+++ b/wp/wp-admin/includes/schema.php
@@ -556,6 +556,9 @@ function populate_options( array $options = array() ) {
// 5.8.0
'wp_force_deactivated_plugins' => array(),
+
+ // 6.4.0
+ 'wp_attachment_pages_enabled' => 0,
);
// 3.3.0
@@ -979,7 +982,7 @@ endif;
* @param string $path Optional. The path to append to the network's domain name. Default '/'.
* @param bool $subdomain_install Optional. Whether the network is a subdomain installation or a subdirectory installation.
* Default false, meaning the network is a subdirectory installation.
- * @return bool|WP_Error True on success, or WP_Error on warning (with the installation otherwise successful,
+ * @return true|WP_Error True on success, or WP_Error on warning (with the installation otherwise successful,
* so the error code must be checked) or failure.
*/
function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) {
diff --git a/wp/wp-admin/includes/template.php b/wp/wp-admin/includes/template.php
index 0771b712..1d4a8e8d 100644
--- a/wp/wp-admin/includes/template.php
+++ b/wp/wp-admin/includes/template.php
@@ -461,7 +461,7 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
' . $upload_dir['error'] . '
- {$plugin['Name']}" );
- ?>
-
-
-
-
-
- ';
+ $local_storage_message .= __( 'This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.' );
+ $local_storage_message .= ' %s %s %s
- Exit Recovery Mode' ),
- esc_url( $url )
- );
- ?>
-
-
-
-
- %2$s | ',
- esc_url( get_edit_profile_url() . '#password' ),
- __( 'Yes, take me to my profile page' )
- );
- printf(
- '%2$s',
- '?default_password_nag=0',
- __( 'No thanks, do not remind me again' )
- );
- ?>
- %2$s | ',
+ esc_url( get_edit_profile_url() . '#password' ),
+ __( 'Yes, take me to my profile page' )
+ );
+ $default_password_nag_message .= sprintf(
+ '%2$s
-
- '+t+" '+t.data.error+" '+t.data.msg+" '+i+" '+o+" '+t+" '+t.data.error+" '+t.data.msg+" '+i+" '+o+"
+
+
Twenty Twenty-Four' ); ?>
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
-
+
@@ -249,7 +252,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
Learn WordPress is a free resource for new and experienced WordPress users. Learn is stocked with how-to videos on using various features in WordPress, interactive events for exploring topics in-depth, and lesson plans for diving deep into specific areas of WordPress.' ),
+ __( 'Learn WordPress is a free resource for new and experienced WordPress users. Learn is stocked with how-to videos on using various features in WordPress, interactive workshops for exploring topics in-depth, and lesson plans for diving deep into specific areas of WordPress.' ),
'https://learn.wordpress.org/',
'https://learn.wordpress.org/online-workshops/'
);
@@ -262,16 +265,17 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
%s
%s',
sprintf(
'',
__( 'Dismiss' )
@@ -126,6 +126,13 @@ if ( is_wp_error( $id ) ) {
),
esc_html( $id->get_error_message() )
);
+ wp_admin_notice(
+ $message,
+ array(
+ 'additional_classes' => array( 'error-div', 'error' ),
+ 'paragraph_wrap' => false,
+ )
+ );
exit;
}
diff --git a/wp/wp-admin/authorize-application.php b/wp/wp-admin/authorize-application.php
index 1eabb963..8d931f46 100644
--- a/wp/wp-admin/authorize-application.php
+++ b/wp/wp-admin/authorize-application.php
@@ -137,9 +137,16 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
wp_opcache_invalidate_directory()'
);
- // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
trigger_error( $error_message );
}
return;
@@ -2726,7 +2788,7 @@ function wp_opcache_invalidate_directory( $dir ) {
* with sub-directories represented as nested arrays.
* @param string $path Absolute path to the directory.
*/
- $invalidate_directory = static function( $dirlist, $path ) use ( &$invalidate_directory ) {
+ $invalidate_directory = static function ( $dirlist, $path ) use ( &$invalidate_directory ) {
$path = trailingslashit( $path );
foreach ( $dirlist as $name => $details ) {
diff --git a/wp/wp-admin/includes/image-edit.php b/wp/wp-admin/includes/image-edit.php
index 72a6d07c..739b09f9 100644
--- a/wp/wp-admin/includes/image-edit.php
+++ b/wp/wp-admin/includes/image-edit.php
@@ -32,15 +32,16 @@ function wp_image_editor( $post_id, $msg = false ) {
$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
$can_restore = false;
+
if ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) ) {
$can_restore = wp_basename( $meta['file'] ) !== $backup_sizes['full-orig']['file'];
}
if ( $msg ) {
if ( isset( $msg->error ) ) {
- $note = "mod_rewrite'
- );
- echo 'mod_rewrite'
- );
- echo 'mod_rewrite',
'https://httpd.apache.org/docs/mod/mod_rewrite.html',
'https://www.google.com/search?q=apache+mod_rewrite'
+ ) . 'wp-config.php',
'.htaccess'
);
} elseif ( file_exists( $home_path . 'web.config' ) ) {
- echo '' . __( 'Caution:' ) . ' ';
- printf(
+ $notice_message .= sprintf(
/* translators: 1: wp-config.php, 2: web.config */
__( 'You should back up your existing %1$s and %2$s files.' ),
'wp-config.php',
'web.config'
);
} else {
- echo '' . __( 'Caution:' ) . ' ';
- printf(
+ $notice_message .= sprintf(
/* translators: %s: wp-config.php */
__( 'You should back up your existing %s file.' ),
'wp-config.php'
);
}
- ?>
-
diff --git a/wp/wp-admin/includes/noop.php b/wp/wp-admin/includes/noop.php
index b29f6044..39dc9702 100644
--- a/wp/wp-admin/includes/noop.php
+++ b/wp/wp-admin/includes/noop.php
@@ -22,6 +22,13 @@ function _x() {}
*/
function add_filter() {}
+/**
+ * @ignore
+ */
+function has_filter() {
+ return false;
+}
+
/**
* @ignore
*/
diff --git a/wp/wp-admin/includes/plugin-install.php b/wp/wp-admin/includes/plugin-install.php
index e2c8de32..76620765 100644
--- a/wp/wp-admin/includes/plugin-install.php
+++ b/wp/wp-admin/includes/plugin-install.php
@@ -316,7 +316,7 @@ function install_dashboard() {
*/
function install_search_form( $deprecated = true ) {
$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
- $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
+ $term = isset( $_REQUEST['s'] ) ? urldecode( wp_unslash( $_REQUEST['s'] ) ) : '';
?>
%s
%s
%s
%s
%s
%s'+n+"
"),u("#bulk-titles .ntdelbutton").click(function(){var t=u(this),e=t.attr("id").substr(1),i=t.parent().prev().children(".ntdelbutton"),t=t.parent().next().children(".ntdelbutton");u('table.widefat input[value="'+e+'"]').prop("checked",!1),u("#_"+e).parent().remove(),h.a11y.speak(h.i18n.__("Item removed."),"assertive"),t.length?t.focus():i.length?i.focus():(u("#bulk-titles-list").remove(),inlineEditPost.revert(),h.a11y.speak(h.i18n.__("All selected items have been removed. Select new items to use Bulk Actions.")))}),"post"===t&&u("tr.inline-editor textarea[data-wp-taxonomy]").each(function(t,e){u(e).autocomplete("instance")||u(e).wpTagsSuggest()}),u("#bulk-edit .inline-edit-wrapper").attr("tabindex","-1").focus(),u("html, body").animate({scrollTop:0},"fast")},edit:function(n){var t,a,e,i,s,r,l,o,d=this,p=!0;for(d.revert(),"object"==typeof n&&(n=d.getId(n)),t=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password","post_format","menu_order","page_template"],"page"===d.type&&t.push("post_parent"),a=u("#inline-edit").clone(!0),u("td",a).attr("colspan",u("th:visible, td:visible",".widefat:first thead").length),u("td",a).find("#quick-edit-legend").removeAttr("id"),u("td",a).find('p[id^="quick-edit-"]').removeAttr("id"),u(d.what+n).removeClass("is-expanded").hide().after(a).after(''),e=u("#inline_"+n),u(':input[name="post_author"] option[value="'+u(".post_author",e).text()+'"]',a).val()||u(':input[name="post_author"]',a).prepend('"),1===u(':input[name="post_author"] option',a).length&&u("label.inline-edit-author",a).hide(),l=0;l ]*?>/g,""),e.removeClass("hidden"),i.html(t),h.a11y.speak(i.text())):(e.removeClass("hidden"),i.text(h.i18n.__("Error while saving the changes.")),h.a11y.speak(h.i18n.__("Error while saving the changes.")))},"html"),!1},revert:function(){var t=u(".widefat"),e=u(".inline-editor",t).attr("id");return e&&(u(".spinner",t).removeClass("is-active"),("bulk-edit"===e?(u("#bulk-edit",t).removeClass("inline-editor").hide().siblings(".hidden").remove(),u("#bulk-titles").empty(),u("#inlineedit").append(u("#bulk-edit")),u("#"+inlineEditPost.whichBulkButtonId)):(u("#"+e).siblings("tr.hidden").addBack().remove(),e=e.substr(e.lastIndexOf("-")+1),u(this.what+e).show().find(".editinline").attr("aria-expanded","false"))).trigger("focus")),!1},getId:function(t){t=u(t).closest("tr").attr("id").split("-");return t[t.length-1]}},u(function(){inlineEditPost.init()}),u(function(){void 0!==h&&h.heartbeat&&h.heartbeat.interval(15)}).on("heartbeat-tick.wp-check-locked-posts",function(t,e){var n=e["wp-check-locked-posts"]||{};u("#the-list tr").each(function(t,e){var i=e.id,e=u(e);n.hasOwnProperty(i)?e.hasClass("wp-locked")||(i=n[i],e.find(".column-title .locked-text").text(i.text),e.find(".check-column checkbox").prop("checked",!1),i.avatar_src&&(i=u(" '),u("#bulk-edit").addClass("inline-editor").show(),u('tbody th.check-column input[type="checkbox"]').each(function(){var t,e,i;u(this).prop("checked")&&(a=!1,t=u(this).val(),e=u("#inline_"+t+" .post_title").html()||h.i18n.__("(no title)"),i=h.i18n.sprintf(h.i18n.__("Remove “%s” from Bulk Edit"),e),n+='",{class:"avatar avatar-18 photo",width:18,height:18,alt:"",src:i.avatar_src,srcset:i.avatar_src_2x?i.avatar_src_2x+" 2x":void 0}),e.find(".column-title .locked-avatar").empty().append(i)),e.addClass("wp-locked")):e.hasClass("wp-locked")&&e.removeClass("wp-locked").find(".locked-info span").empty()})}).on("heartbeat-send.wp-check-locked-posts",function(t,e){var i=[];u("#the-list tr").each(function(t,e){e.id&&i.push(e.id)}),i.length&&(e["wp-check-locked-posts"]=i)})}(jQuery,window.wp);
\ No newline at end of file
+window.wp=window.wp||{},function(u,h){window.inlineEditPost={init:function(){var i=this,t=u("#inline-edit"),e=u("#bulk-edit");i.type=u("table.widefat").hasClass("pages")?"page":"post",i.what="#post-",t.on("keyup",function(t){if(27===t.which)return inlineEditPost.revert()}),e.on("keyup",function(t){if(27===t.which)return inlineEditPost.revert()}),u(".cancel",t).on("click",function(){return inlineEditPost.revert()}),u(".save",t).on("click",function(){return inlineEditPost.save(this)}),u("td",t).on("keydown",function(t){if(13===t.which&&!u(t.target).hasClass("cancel"))return inlineEditPost.save(this)}),u(".cancel",e).on("click",function(){return inlineEditPost.revert()}),u('#inline-edit .inline-edit-private input[value="private"]').on("click",function(){var t=u("input.inline-edit-password-input");u(this).prop("checked")?t.val("").prop("disabled",!0):t.prop("disabled",!1)}),u("#the-list").on("click",".editinline",function(){u(this).attr("aria-expanded","true"),inlineEditPost.edit(this)}),u("#bulk-edit").find("fieldset:first").after(u("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(u("#inline-edit .inline-edit-tags-wrap").clone()),u('select[name="_status"] option[value="future"]',e).remove(),u("#doaction").on("click",function(t){var e;i.whichBulkButtonId=u(this).attr("id"),e=i.whichBulkButtonId.substr(2),"edit"===u('select[name="'+e+'"]').val()?(t.preventDefault(),i.setBulk()):0
'+n+"
"),u("#bulk-titles .ntdelbutton").click(function(){var t=u(this),e=t.attr("id").substr(1),i=t.parent().prev().children(".ntdelbutton"),t=t.parent().next().children(".ntdelbutton");u('table.widefat input[value="'+e+'"]').prop("checked",!1),u("#_"+e).parent().remove(),h.a11y.speak(h.i18n.__("Item removed."),"assertive"),t.length?t.focus():i.length?i.focus():(u("#bulk-titles-list").remove(),inlineEditPost.revert(),h.a11y.speak(h.i18n.__("All selected items have been removed. Select new items to use Bulk Actions.")))}),"post"===t&&u("tr.inline-editor textarea[data-wp-taxonomy]").each(function(t,e){u(e).autocomplete("instance")||u(e).wpTagsSuggest()}),u("#bulk-edit .inline-edit-wrapper").attr("tabindex","-1").focus(),u("html, body").animate({scrollTop:0},"fast")},edit:function(n){var t,a,e,i,s,r,l,o,d=this,p=!0;for(d.revert(),"object"==typeof n&&(n=d.getId(n)),t=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password","post_format","menu_order","page_template"],"page"===d.type&&t.push("post_parent"),a=u("#inline-edit").clone(!0),u("td",a).attr("colspan",u("th:visible, td:visible",".widefat:first thead").length),u("td",a).find("#quick-edit-legend").removeAttr("id"),u("td",a).find('p[id^="quick-edit-"]').removeAttr("id"),u(d.what+n).removeClass("is-expanded").hide().after(a).after(''),e=u("#inline_"+n),u(':input[name="post_author"] option[value="'+u(".post_author",e).text()+'"]',a).val()||u(':input[name="post_author"]',a).prepend('"),1===u(':input[name="post_author"] option',a).length&&u("label.inline-edit-author",a).hide(),l=0;l ]*?>/g,""),e.removeClass("hidden"),i.html(t),h.a11y.speak(i.text())):(e.removeClass("hidden"),i.text(h.i18n.__("Error while saving the changes.")),h.a11y.speak(h.i18n.__("Error while saving the changes.")))},"html"),!1},revert:function(){var t=u(".widefat"),e=u(".inline-editor",t).attr("id");return e&&(u(".spinner",t).removeClass("is-active"),("bulk-edit"===e?(u("#bulk-edit",t).removeClass("inline-editor").hide().siblings(".hidden").remove(),u("#bulk-titles").empty(),u("#inlineedit").append(u("#bulk-edit")),u("#"+inlineEditPost.whichBulkButtonId)):(u("#"+e).siblings("tr.hidden").addBack().remove(),e=e.substr(e.lastIndexOf("-")+1),u(this.what+e).show().find(".editinline").attr("aria-expanded","false"))).trigger("focus")),!1},getId:function(t){t=u(t).closest("tr").attr("id").split("-");return t[t.length-1]}},u(function(){inlineEditPost.init()}),u(function(){void 0!==h&&h.heartbeat&&h.heartbeat.interval(15)}).on("heartbeat-tick.wp-check-locked-posts",function(t,e){var n=e["wp-check-locked-posts"]||{};u("#the-list tr").each(function(t,e){var i=e.id,e=u(e);n.hasOwnProperty(i)?e.hasClass("wp-locked")||(i=n[i],e.find(".column-title .locked-text").text(i.text),e.find(".check-column checkbox").prop("checked",!1),i.avatar_src&&(i=u(" ",{class:"avatar avatar-18 photo",width:18,height:18,alt:"",src:i.avatar_src,srcset:i.avatar_src_2x?i.avatar_src_2x+" 2x":void 0}),e.find(".column-title .locked-avatar").empty().append(i)),e.addClass("wp-locked")):e.hasClass("wp-locked")&&e.removeClass("wp-locked").find(".locked-info span").empty()})}).on("heartbeat-send.wp-check-locked-posts",function(t,e){var i=[];u("#the-list tr").each(function(t,e){e.id&&i.push(e.id)}),i.length&&(e["wp-check-locked-posts"]=i)})}(jQuery,window.wp);
\ No newline at end of file
diff --git a/wp/wp-admin/js/post.js b/wp/wp-admin/js/post.js
index 6b96ad25..a86ea4c8 100644
--- a/wp/wp-admin/js/post.js
+++ b/wp/wp-admin/js/post.js
@@ -511,7 +511,7 @@ jQuery( function($) {
// See https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event.
return __( 'The changes you made will be lost if you navigate away from this page.' );
}
- }).on( 'unload.edit-post', function( event ) {
+ }).on( 'pagehide.edit-post', function( event ) {
if ( ! releaseLock ) {
return;
}
diff --git a/wp/wp-admin/js/post.min.js b/wp/wp-admin/js/post.min.js
index af680ba8..1bbdd27c 100644
--- a/wp/wp-admin/js/post.min.js
+++ b/wp/wp-admin/js/post.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-window.makeSlugeditClickable=window.editPermalink=function(){},window.wp=window.wp||{},function(s){var t=!1,a=wp.i18n.__;window.commentsBox={st:0,get:function(t,e){var i=this.st;return this.st+=e=e||20,this.total=t,s("#commentsdiv .spinner").addClass("is-active"),t={action:"get-comments",mode:"single",_ajax_nonce:s("#add_comment_nonce").val(),p:s("#post_ID").val(),start:i,number:e},s.post(ajaxurl,t,function(t){t=wpAjax.parseAjaxResponse(t),s("#commentsdiv .widefat").show(),s("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof t&&t.responses[0]?(s("#the-comment-list").append(t.responses[0].data),theList=theExtraList=null,s("a[className*=':']").off(),commentsBox.st>commentsBox.total?s("#show-comments").hide():s("#show-comments").show().children("a").text(a("Show more comments"))):1==t?s("#show-comments").text(a("No more comments found.")):s("#the-comment-list").append('
")}),!1},load:function(t){this.st=jQuery("#the-comment-list tr.comment:visible").length,this.get(t)}},window.WPSetThumbnailHTML=function(t){s(".inside","#postimagediv").html(t)},window.WPSetThumbnailID=function(t){var e=s('input[value="_thumbnail_id"]',"#list-table");0'+wpAjax.broken+" ")}),!1},load:function(t){this.st=jQuery("#the-comment-list tr.comment:visible").length,this.get(t)}},window.WPSetThumbnailHTML=function(t){s(".inside","#postimagediv").html(t)},window.WPSetThumbnailID=function(t){var e=s('input[value="_thumbnail_id"]',"#list-table");0'+wpAjax.broken+"
"+t+"
",actions:""};d(wp.hooks.applyFilters("site_status_test_result",e))}function s(){var t=(new Date).getTime(),s=window.setTimeout(function(){wp.a11y.speak(l("Please wait..."))},3e3);wp.apiRequest({path:"/wp-site-health/v1/directory-sizes"}).done(function(e){var a,s;a=e||{},e=o("button.button.copy-button"),s=e.attr("data-clipboard-text"),o.each(a,function(e,t){t=t.debug||t.size;void 0!==t&&(s=s.replace(e+": loading...",e+": "+t))}),e.attr("data-clipboard-text",s),i.find("td[class]").each(function(e,t){var t=o(t),s=t.attr("class");a.hasOwnProperty(s)&&a[s].size&&t.text(a[s].size)})}).always(function(){var e=(new Date).getTime()-t;o(".health-check-wp-paths-sizes.spinner").css("visibility","hidden"),p(),3e3"+t+"
",actions:""};d(wp.hooks.applyFilters("site_status_test_result",e))}function s(){var t=(new Date).getTime(),s=window.setTimeout(function(){m("waiting-for-directory-sizes")},3e3);wp.apiRequest({path:"/wp-site-health/v1/directory-sizes"}).done(function(e){var a,s;a=e||{},e=o("button.button.copy-button"),s=e.attr("data-clipboard-text"),o.each(a,function(e,t){t=t.debug||t.size;void 0!==t&&(s=s.replace(e+": loading...",e+": "+t))}),e.attr("data-clipboard-text",s),i.find("td[class]").each(function(e,t){var t=o(t),s=t.attr("class");a.hasOwnProperty(s)&&a[s].size&&t.text(a[s].size)})}).always(function(){var e=(new Date).getTime()-t;o(".health-check-wp-paths-sizes.spinner").css("visibility","hidden"),3e3'; $deleted = (int) $_REQUEST['deleted']; /* translators: %s: Number of links. */ - printf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted ); - echo '
'; + $deleted_message = sprintf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted ); + wp_admin_notice( + $deleted_message, + array( + 'id' => 'message', + 'additional_classes' => array( 'updated' ), + 'dismissible' => true, + ) + ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] ); } ?> diff --git a/wp/wp-admin/link.php b/wp/wp-admin/link.php index 084b1d75..f07cc589 100644 --- a/wp/wp-admin/link.php +++ b/wp/wp-admin/link.php @@ -45,7 +45,7 @@ switch ( $action ) { $link_id = (int) $link_id; if ( wp_delete_link( $link_id ) ) { - $deleted++; + ++$deleted; } } diff --git a/wp/wp-admin/maint/repair.php b/wp/wp-admin/maint/repair.php index 554e466d..1c0f6ffa 100644 --- a/wp/wp-admin/maint/repair.php +++ b/wp/wp-admin/maint/repair.php @@ -7,7 +7,7 @@ */ define( 'WP_REPAIRING', true ); -require_once dirname( dirname( __DIR__ ) ) . '/wp-load.php'; +require_once dirname( __DIR__, 2 ) . '/wp-load.php'; header( 'Content-Type: text/html; charset=utf-8' ); ?> diff --git a/wp/wp-admin/media-upload.php b/wp/wp-admin/media-upload.php index 7f943a82..015bc9d6 100644 --- a/wp/wp-admin/media-upload.php +++ b/wp/wp-admin/media-upload.php @@ -116,4 +116,3 @@ if ( 'type' === $tab || 'type_url' === $tab || ! array_key_exists( $tab, media_u */ do_action( "media_upload_{$tab}" ); } - diff --git a/wp/wp-admin/menu.php b/wp/wp-admin/menu.php index 17317f9d..567af4ae 100644 --- a/wp/wp-admin/menu.php +++ b/wp/wp-admin/menu.php @@ -63,10 +63,9 @@ $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' ); // $menu[5] = Posts. -$menu[10] = array( __( 'Media' ), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'dashicons-admin-media' ); - $submenu['upload.php'][5] = array( __( 'Library' ), 'upload_files', 'upload.php' ); - /* translators: Add new file. */ - $submenu['upload.php'][10] = array( _x( 'Add New', 'file' ), 'upload_files', 'media-new.php' ); +$menu[10] = array( __( 'Media' ), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'dashicons-admin-media' ); + $submenu['upload.php'][5] = array( __( 'Library' ), 'upload_files', 'upload.php' ); + $submenu['upload.php'][10] = array( __( 'Add New Media File' ), 'upload_files', 'media-new.php' ); $i = 15; foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) { if ( ! $tax->show_ui || ! $tax->show_in_menu ) { @@ -77,10 +76,9 @@ foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) { } unset( $tax, $i ); -$menu[15] = array( __( 'Links' ), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'dashicons-admin-links' ); - $submenu['link-manager.php'][5] = array( _x( 'All Links', 'admin menu' ), 'manage_links', 'link-manager.php' ); - /* translators: Add new links. */ - $submenu['link-manager.php'][10] = array( _x( 'Add New', 'link' ), 'manage_links', 'link-add.php' ); +$menu[15] = array( __( 'Links' ), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'dashicons-admin-links' ); + $submenu['link-manager.php'][5] = array( _x( 'All Links', 'admin menu' ), 'manage_links', 'link-manager.php' ); + $submenu['link-manager.php'][10] = array( __( 'Add New Link' ), 'manage_links', 'link-add.php' ); $submenu['link-manager.php'][15] = array( __( 'Link Categories' ), 'manage_categories', 'edit-tags.php?taxonomy=link_category' ); // $menu[20] = Pages. @@ -163,7 +161,7 @@ foreach ( array_merge( $builtin, $types ) as $ptype ) { */ $core_menu_positions = array( 59, 60, 65, 70, 75, 80, 85, 99 ); while ( isset( $menu[ $ptype_menu_position ] ) || in_array( $ptype_menu_position, $core_menu_positions, true ) ) { - $ptype_menu_position++; + ++$ptype_menu_position; } $menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon ); @@ -304,8 +302,7 @@ $menu[65] = array( sprintf( __( 'Plugins %s' ), $count ), 'activate_plugins', 'p $submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' ); if ( ! is_multisite() ) { - /* translators: Add new plugin. */ - $submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' ); + $submenu['plugins.php'][10] = array( __( 'Add New Plugin' ), 'install_plugins', 'plugin-install.php' ); if ( wp_is_block_theme() ) { // Place the menu item below the Theme File Editor menu item. add_action( 'admin_menu', '_add_plugin_file_editor_to_tools', 101 ); @@ -326,9 +323,9 @@ if ( current_user_can( 'list_users' ) ) { $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php. $submenu['users.php'][5] = array( __( 'All Users' ), 'list_users', 'users.php' ); if ( current_user_can( 'create_users' ) ) { - $submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'create_users', 'user-new.php' ); + $submenu['users.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' ); } elseif ( is_multisite() ) { - $submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'promote_users', 'user-new.php' ); + $submenu['users.php'][10] = array( __( 'Add New User' ), 'promote_users', 'user-new.php' ); } $submenu['users.php'][15] = array( __( 'Profile' ), 'read', 'profile.php' ); diff --git a/wp/wp-admin/my-sites.php b/wp/wp-admin/my-sites.php index e395579e..be7f63bb 100644 --- a/wp/wp-admin/my-sites.php +++ b/wp/wp-admin/my-sites.php @@ -55,9 +55,17 @@ get_current_screen()->set_help_sidebar( require_once ABSPATH . 'wp-admin/admin-header.php'; -if ( $updated ) { ?> -' . __( 'The menu item has been successfully deleted.' ) . '
' . $deletion->get_error_message() . '
' . __( 'The menu has been successfully deleted.' ) . '
' . $deletion->get_error_message() . '
' . __( 'Selected menus have been successfully deleted.' ) . '
' . $_nav_menu_selected_id->get_error_message() . '
' . __( 'Please enter a valid menu name.' ) . '
' . __( 'Please enter a valid menu name.' ) . '
' . $_nav_menu_selected_id->get_error_message() . '
' . __( 'Menu locations updated.' ) . '
' . sprintf( + $message_no_theme_support = sprintf( /* translators: %s: URL to Widgets screen. */ __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Navigation Menu” widget on the Widgets screen.' ), admin_url( 'widgets.php' ) - ) . '
- ' . esc_html( $new_admin_email ) . '' - ); - printf( - ' %2$s', - esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ), - __( 'Cancel' ) - ); - ?> -
-' . esc_html( $new_admin_email ) . ''
+ );
+
+ $notice_message .= sprintf(
+ ' %2$s',
+ esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),
+ __( 'Cancel' )
+ );
+
+ wp_admin_notice(
+ $notice_message,
+ array(
+ 'type' => 'warning',
+ 'dismissible' => true,
+ 'additional_classes' => array( 'inline' ),
+ )
+ );
+ endif;
+ ?>
diff --git a/wp/wp-admin/network/site-info.php b/wp/wp-admin/network/site-info.php
index 6030dcd5..defcc26e 100644
--- a/wp/wp-admin/network/site-info.php
+++ b/wp/wp-admin/network/site-info.php
@@ -146,8 +146,14 @@ network_edit_site_nav(
);
if ( ! empty( $messages ) ) {
+ $notice_args = array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ );
+
foreach ( $messages as $msg ) {
- echo '' . $msg . '
' . $msg . '
' . $msg . '
' . sprintf( $message, number_format_i18n( $enabled ) ) . '
' . sprintf( $message, number_format_i18n( $disabled ) ) . '
' . __( 'No theme selected.' ) . '
' . __( 'User added.' ) . '
' . __( 'User is already a member of this site.' ) . '
' . __( 'User could not be added to this site.' ) . '
' . __( 'Enter the username of an existing user.' ) . '
' . __( 'Changed roles.' ) . '
' . __( 'Select a user to change role.' ) . '
' . __( 'User removed from this site.' ) . '
' . __( 'Select a user to remove.' ) . '
' . __( 'User created.' ) . '
' . __( 'Enter the username and email.' ) . '
' . __( 'Duplicated username or email address.' ) . '
' . $msg . '
' . sprintf( $message, number_format_i18n( $enabled ) ) . '
'; } elseif ( isset( $_GET['disabled'] ) ) { $disabled = absint( $_GET['disabled'] ); if ( 1 === $disabled ) { $message = __( 'Theme disabled.' ); } else { - /* translators: %s: Number of themes. */ - $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled ); + $message = sprintf( + /* translators: %s: Number of themes. */ + _n( '%s theme disabled.', '%s themes disabled.', $disabled ), + number_format_i18n( $disabled ) + ); } - echo '' . sprintf( $message, number_format_i18n( $disabled ) ) . '
' . sprintf( $message, number_format_i18n( $deleted ) ) . '
' . sprintf( $message, number_format_i18n( $enabled ) ) . '
' . sprintf( $message, number_format_i18n( $disabled ) ) . '
' . __( 'No theme selected.' ) . '
' . __( 'You cannot delete a theme while it is active on the main site.' ) . '
' . $message . '
'; + wp_admin_notice( + $message, + array( + 'type' => 'success', + 'dismissible' => true, + 'id' => 'message', + ) + ); } if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) { - ?> -$error
"; - } - ?> -$error
"; + } + + wp_admin_notice( + $error_messages, + array( + 'type' => 'error', + 'dismissible' => true, + 'id' => 'message', + 'paragraph_wrap' => false, + ) + ); +} +?>'; - printf( + $message = sprintf( /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */ __( 'Important: Before updating, please back up your database and files. For help with updates, visit the Updating WordPress documentation page.' ), __( 'https://wordpress.org/documentation/article/wordpress-backups/' ), __( 'https://wordpress.org/documentation/article/updating-wordpress/' ) ); - echo '
' . $notice_text . '
' . $notice_text . '
@@ -749,7 +760,8 @@ function list_theme_updates() {
@@ -1061,16 +1072,22 @@ if ( 'upgrade-core' === $action ) { if ( 'themes' === $upgrade_error ) { $theme_updates = get_theme_updates(); if ( ! empty( $theme_updates ) ) { - echo '
'; - _e( 'Please select one or more themes to update.' ); - echo '
'; - _e( 'Please select one or more plugins to update.' ); - echo '
\n
", $errors->get_error_messages() ); ?>
-", $errors->get_error_messages() ), + array( + 'additional_classes' => array( 'error' ), + ) + ); + } + ?>
- ' . esc_html( $new_email['newemail'] ) . '' - ); - printf( - ' %2$s', - esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ), - __( 'Cancel' ) - ); - ?> -
-' . esc_html( $new_email['newemail'] ) . ''
+ );
+ $pending_change_message .= sprintf(
+ ' %2$s',
+ esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ),
+ __( 'Cancel' )
+ );
+ wp_admin_notice(
+ $pending_change_message,
+ array(
+ 'additional_classes' => array( 'updated', 'inline' ),
+ )
+ );
+ endif;
+ ?>
" + body + "
", settings]); + WFLS._panelServiceQueue(); + }, + + /** + * Displays a modal panel with fixed HTML content. + * + * @param @param string width A width string in the format '100px' + * @param string heading + * @param string body + * @param object settings + */ + panelModalHTML: function(width, heading, body, settings) { + if (typeof settings === 'undefined') { + settings = {}; + } + + var prompt = $.tmpl(WFLSVars.modalHTMLTemplate, {title: heading, message: body}); + var promptHTML = $("").append(prompt).html(); + var callback = settings.onComplete; + settings.overlayClose = false; + settings.closeButton = false; + settings.className = 'wfls-modal'; + settings.onComplete = function() { + $('#wfls-generic-modal-close').on('click', function(e) { + e.preventDefault(); + e.stopPropagation(); + + WFLS.panelClose(); + }); + + typeof callback === 'function' && callback(); + }; + WFLS.panelHTML(width, promptHTML, settings) + }, + + /** + * Displays a modal panel, automatically escaping the content. + * + * @param @param string width A width string in the format '100px' + * @param string heading + * @param string body + * @param object settings + */ + panelModal: function(width, heading, body, settings) { + if (typeof settings === 'undefined') { + settings = {}; + } + + if (width === null) + width = WFLS.screenSize(500) ? '300px' : '400px'; + + var includeDefaultButtons = typeof settings.includeDefaultButtons === 'undefined' ? false : settings.includeDefaultButtons; + var prompt = $.tmpl(WFLSVars[includeDefaultButtons ? 'modalTemplate' : 'modalNoButtonsTemplate'], {title: heading, message: body}); + + if (typeof settings.additional_buttons !== 'undefined') { + var buttonSection = prompt.find('.wfls-modal-footer > ul'); + for(index in settings.additional_buttons) { + var buttonSettings = settings.additional_buttons[index]; + var button = $('