Upgrade/Install: Update available theme updates count when a theme si deleted.

This changeset fixes an issue where the available theme updates count was not updated after a theme is deleted.

Props nazmulhasan103, riccardodicurti, sabernhardt, ironprogrammer, costdev, robinwpdeveloper, rahmantasnia.
Fixes #57183.


git-svn-id: https://develop.svn.wordpress.org/trunk@55359 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras 2023-02-17 09:52:28 +00:00
parent cb5eb45fab
commit 7a004e8620

View File

@ -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 );