mirror of
git://develop.git.wordpress.org/
synced 2025-02-12 10:50:25 +01:00
Update/Install: Correctly decrement the update count after translation updates.
After [37714], an error was unnecessarily being displayed in the JavaScript console when updating translations on `wp-admin/update-core.php`. Let's not throw an error in these cases. Props afercia. Fixes #37127. git-svn-id: https://develop.svn.wordpress.org/trunk@37971 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
431c469497
commit
31ae7b3d85
@ -295,20 +295,12 @@
|
||||
$dashboardNavMenuUpdateCount.removeAttr( 'title' );
|
||||
$dashboardNavMenuUpdateCount.find( '.update-count' ).text( count );
|
||||
|
||||
switch ( type ) {
|
||||
case 'plugin':
|
||||
$menuItem = $( '#menu-plugins' );
|
||||
$itemCount = $menuItem.find( '.plugin-count' );
|
||||
break;
|
||||
|
||||
case 'theme':
|
||||
$menuItem = $( '#menu-appearance' );
|
||||
$itemCount = $menuItem.find( '.theme-count' );
|
||||
break;
|
||||
|
||||
default:
|
||||
window.console.error( '"%s" is not white-listed to have its count decremented.', type );
|
||||
return;
|
||||
if ( 'plugin' === type ) {
|
||||
$menuItem = $( '#menu-plugins' );
|
||||
$itemCount = $menuItem.find( '.plugin-count' );
|
||||
} else if ( 'theme' === type ) {
|
||||
$menuItem = $( '#menu-appearance' );
|
||||
$itemCount = $menuItem.find( '.theme-count' );
|
||||
}
|
||||
|
||||
// Decrement the counter of the other menu items.
|
||||
|
Loading…
x
Reference in New Issue
Block a user