WordPress.org

Make WordPress Core

Changeset 37971


Ignore:
Timestamp:
07/05/2016 03:17:20 PM (3 years ago)
Author:
swissspidy
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/updates.js

    r37970 r37971  
    296296        $dashboardNavMenuUpdateCount.find( '.update-count' ).text( count );
    297297
    298         switch ( type ) {
    299             case 'plugin':
    300                 $menuItem  = $( '#menu-plugins' );
    301                 $itemCount = $menuItem.find( '.plugin-count' );
    302                 break;
    303 
    304             case 'theme':
    305                 $menuItem  = $( '#menu-appearance' );
    306                 $itemCount = $menuItem.find( '.theme-count' );
    307                 break;
    308 
    309             default:
    310                 window.console.error( '"%s" is not white-listed to have its count decremented.', type );
    311                 return;
     298        if ( 'plugin' === type ) {
     299            $menuItem  = $( '#menu-plugins' );
     300            $itemCount = $menuItem.find( '.plugin-count' );
     301        } else if ( 'theme' === type ) {
     302            $menuItem  = $( '#menu-appearance' );
     303            $itemCount = $menuItem.find( '.theme-count' );
    312304        }
    313305
Note: See TracChangeset for help on using the changeset viewer.