Upgrade/Install: Update screen reader text counts in adminbar.

Update the hidden screen-reader-text update count in the adminbar when updates are run on the plugin or theme screens.

Props pento, paulschreiber, adamsilverstein, afercia, SergeyBiryukov, sabernhardt.
Fixes #29022.
Built from https://develop.svn.wordpress.org/trunk@52139


git-svn-id: http://core.svn.wordpress.org/trunk@51731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2021-11-11 17:20:58 +00:00
parent 2ff53354c1
commit 356fe8c2dd
3 changed files with 10 additions and 3 deletions

View File

@ -33,6 +33,7 @@
var $document = $( document ), var $document = $( document ),
__ = wp.i18n.__, __ = wp.i18n.__,
_x = wp.i18n._x, _x = wp.i18n._x,
_n = wp.i18n._n,
sprintf = wp.i18n.sprintf; sprintf = wp.i18n.sprintf;
wp = wp || {}; wp = wp || {};
@ -352,8 +353,14 @@
$appearanceNavMenuUpdateCount = $( 'a[href="themes.php"] .update-plugins' ), $appearanceNavMenuUpdateCount = $( 'a[href="themes.php"] .update-plugins' ),
itemCount; itemCount;
$adminBarUpdates.find( '.ab-item' ).removeAttr( 'title' );
$adminBarUpdates.find( '.ab-label' ).text( settings.totals.counts.total ); $adminBarUpdates.find( '.ab-label' ).text( settings.totals.counts.total );
$adminBarUpdates.find( '.updates-available-text' ).text(
sprintf(
/* translators: %s: Total number of updates available. */
_n( '%s update available', '%s updates available', settings.totals.counts.total ),
settings.totals.counts.total
)
);
// Remove the update count from the toolbar if it's zero. // Remove the update count from the toolbar if it's zero.
if ( 0 === settings.totals.counts.total ) { if ( 0 === settings.totals.counts.total ) {

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.9-alpha-52138'; $wp_version = '5.9-alpha-52139';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.