mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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:
parent
cb5eb45fab
commit
7a004e8620
@ -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 );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user