diff --git a/src/js/_enqueues/wp/updates.js b/src/js/_enqueues/wp/updates.js index c6d0ff56f2c3d..d11d8a4f2aaec 100644 --- a/src/js/_enqueues/wp/updates.js +++ b/src/js/_enqueues/wp/updates.js @@ -5,7 +5,7 @@ * @output wp-admin/js/updates.js */ -/* global pagenow */ +/* global pagenow, _wpThemeSettings */ /** * @param {jQuery} $ jQuery object. @@ -1614,6 +1614,14 @@ } ); } + // DecrementCount from update count. + if ( 'themes' === pagenow ) { + var theme = _.find( _wpThemeSettings.themes, { id: response.slug } ); + if ( theme.hasUpdate ) { + wp.updates.decrementCount( 'theme' ); + } + } + wp.a11y.speak( _x( 'Deleted!', 'theme' ) ); $document.trigger( 'wp-theme-delete-success', response );