diff --git a/src/js/_enqueues/wp/updates.js b/src/js/_enqueues/wp/updates.js index ef4b47e66093e..af407f7026d08 100644 --- a/src/js/_enqueues/wp/updates.js +++ b/src/js/_enqueues/wp/updates.js @@ -391,7 +391,7 @@ $pluginsNavMenuUpdateCount.each( function( index, element ) { element.className = element.className.replace( /count-\d+/, 'count-' + settings.totals.counts.plugins ); } ); - if ( settings.totals.counts.total > 0 ) { + if ( settings.totals.counts.plugins > 0 ) { $pluginsNavMenuUpdateCount.find( '.plugin-count' ).text( settings.totals.counts.plugins ); } else { $pluginsNavMenuUpdateCount.remove(); @@ -401,7 +401,7 @@ $appearanceNavMenuUpdateCount.each( function( index, element ) { element.className = element.className.replace( /count-\d+/, 'count-' + settings.totals.counts.themes ); } ); - if ( settings.totals.counts.total > 0 ) { + if ( settings.totals.counts.themes > 0 ) { $appearanceNavMenuUpdateCount.find( '.theme-count' ).text( settings.totals.counts.themes ); } else { $appearanceNavMenuUpdateCount.remove(); diff --git a/tests/qunit/fixtures/updates.js b/tests/qunit/fixtures/updates.js index 7e31370814880..4ee72d9eb4bff 100644 --- a/tests/qunit/fixtures/updates.js +++ b/tests/qunit/fixtures/updates.js @@ -59,5 +59,13 @@ window._wpUpdatesSettings = { }; window._wpUpdatesItemCounts = { plugins: {}, - totals: {} + totals: { + counts: { + plugins: 2, + themes: 0, + wordpress: 0, + translations: 0, + total: 2 + } + } }; diff --git a/tests/qunit/index.html b/tests/qunit/index.html index 9fd35f0c1ffc2..7dd58bbacaf20 100644 --- a/tests/qunit/index.html +++ b/tests/qunit/index.html @@ -2314,6 +2314,12 @@