summaryrefslogtreecommitdiffstats
path: root/wp-admin/js/updates.js
diff options
context:
space:
mode:
Diffstat (limited to 'wp-admin/js/updates.js')
-rw-r--r--wp-admin/js/updates.js40
1 files changed, 34 insertions, 6 deletions
diff --git a/wp-admin/js/updates.js b/wp-admin/js/updates.js
index a7c949a..806dd62 100644
--- a/wp-admin/js/updates.js
+++ b/wp-admin/js/updates.js
@@ -875,7 +875,7 @@
$card
.addClass( 'plugin-card-update-failed' )
- .append( '<div class="notice notice-error notice-alt is-dismissible"><p>' + errorMessage + '</p></div>' );
+ .append( '<div class="notice notice-error notice-alt is-dismissible" role="alert"><p>' + errorMessage + '</p></div>' );
$card.on( 'click', '.notice.is-dismissible .notice-dismiss', function() {
@@ -2260,7 +2260,7 @@
// Remove any existing error.
$filesystemForm.find( '.notice' ).remove();
- $filesystemForm.find( '#request-filesystem-credentials-title' ).after( '<div class="notice notice-alt notice-error"><p>' + message + '</p></div>' );
+ $filesystemForm.find( '#request-filesystem-credentials-title' ).after( '<div class="notice notice-alt notice-error" role="alert"><p>' + message + '</p></div>' );
};
/**
@@ -2913,13 +2913,41 @@
wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
+ var successMessage = null;
+
+ if ( success ) {
+ if ( 'plugin' === response.update ) {
+ successMessage = sprintf(
+ /* translators: %s: Number of plugins. */
+ _n( '%s plugin successfully updated.', '%s plugins successfully updated.', success ),
+ success
+ );
+ } else {
+ successMessage = sprintf(
+ /* translators: %s: Number of themes. */
+ _n( '%s theme successfully updated.', '%s themes successfully updated.', success ),
+ success
+ );
+ }
+ }
+
+ var errorMessage = null;
+
+ if ( error ) {
+ errorMessage = sprintf(
+ /* translators: %s: Number of failed updates. */
+ _n( '%s update failed.', '%s updates failed.', error ),
+ error
+ );
+ }
+
wp.updates.addAdminNotice( {
id: 'bulk-action-notice',
className: 'bulk-action-notice',
- successes: success,
- errors: error,
- errorMessages: errorMessages,
- type: response.update
+ successMessage: successMessage,
+ errorMessage: errorMessage,
+ errorMessages: errorMessages,
+ type: response.update
} );
$bulkActionNotice = $( '#bulk-action-notice' ).on( 'click', 'button', function() {