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.

Built from https://develop.svn.wordpress.org/trunk@55359


git-svn-id: http://core.svn.wordpress.org/trunk@54892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-02-17 09:54:19 +00:00
parent 1b873c8a19
commit 818e9581a8
3 changed files with 11 additions and 3 deletions

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

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.2-beta2-55358';
$wp_version = '6.2-beta2-55359';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.