Administration: Make sure auto-update counts properly update when bulk deleting plugins or themes.

Props pbiron, noisysocks, desrosj, audrasjb, hellofromTonya.
Fixes #50870.

git-svn-id: https://develop.svn.wordpress.org/trunk@49582 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-11-12 20:40:13 +00:00
parent f517634e28
commit 17f7e5fc98
3 changed files with 72 additions and 28 deletions
@@ -206,9 +206,11 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
$themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( $this, '_search_callback' ) );
}
$totals = array();
$totals = array();
$js_themes = array();
foreach ( $themes as $type => $list ) {
$totals[ $type ] = count( $list );
$totals[ $type ] = count( $list );
$js_themes[ $type ] = array_keys( $list );
}
if ( empty( $themes[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) {
@@ -225,7 +227,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
'updates',
'_wpUpdatesItemCounts',
array(
'themes' => $totals,
'themes' => $js_themes,
'totals' => wp_get_update_data(),
)
);
@@ -317,7 +317,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
$js_plugins = array();
foreach ( $plugins as $key => $list ) {
$js_plugins[ $key ] = array_keys( (array) $list );
$js_plugins[ $key ] = array_keys( $list );
}
wp_localize_script(