Make WordPress Core

Ticket #42365: 42365.diff

File 42365.diff, 1.3 KB (added by celloexpressions, 8 years ago)

Don't try to update counts that don't exist.

  • src/wp-admin/js/updates.js

     
    277277                        $appearanceNavMenuUpdateCount = $( 'a[href="themes.php"] .update-plugins' ),
    278278                        itemCount;
    279279
     280                // There are no counts in the customizer.
     281                if ( 'customize' === pagenow ) {
     282                        return;
     283                }
     284
    280285                $adminBarUpdates.find( '.ab-item' ).removeAttr( 'title' );
    281286                $adminBarUpdates.find( '.ab-label' ).text( settings.totals.counts.total );
    282287
     
    342347         *                      Can be 'plugin', 'theme'.
    343348         */
    344349        wp.updates.decrementCount = function( type ) {
     350                // There are no counts in the customizer.
     351                if ( 'customize' === pagenow ) {
     352                        return;
     353                }
     354
    345355                settings.totals.counts.total = Math.max( --settings.totals.counts.total, 0 );
    346356
    347357                if ( 'plugin' === type ) {
     
    942951                        $notice.find( 'h3' ).remove();
    943952
    944953                        // Add the top-level UI, and update both.
    945                         $notice = $notice.add( $( '#customize-control-theme-installed_' + args.slug ).find( '.update-message' ) );
     954                        $notice = $notice.add( $( '#customize-control-installed_theme_' + args.slug ).find( '.update-message' ) );
    946955                        $notice = $notice.addClass( 'updating-message' ).find( 'p' );
    947956
    948957                } else {