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.removeAttr( 'title' );
|
||||||
$dashboardNavMenuUpdateCount.find( '.update-count' ).text( count );
|
$dashboardNavMenuUpdateCount.find( '.update-count' ).text( count );
|
||||||
|
|
||||||
switch ( type ) {
|
if ( 'plugin' === type ) {
|
||||||
case 'plugin':
|
$menuItem = $( '#menu-plugins' );
|
||||||
$menuItem = $( '#menu-plugins' );
|
$itemCount = $menuItem.find( '.plugin-count' );
|
||||||
$itemCount = $menuItem.find( '.plugin-count' );
|
} else if ( 'theme' === type ) {
|
||||||
break;
|
$menuItem = $( '#menu-appearance' );
|
||||||
|
$itemCount = $menuItem.find( '.theme-count' );
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decrement the counter of the other menu items.
|
// Decrement the counter of the other menu items.
|
||||||
|
|
Loading…
Reference in New Issue