Make WordPress Core

Changeset 55359


Ignore:
Timestamp:
02/17/2023 09:52:28 AM (14 months ago)
Author:
audrasjb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/updates.js

    r54904 r55359  
    66 */
    77
    8 /* global pagenow */
     8/* global pagenow, _wpThemeSettings */
    99
    1010/**
     
    16151615        }
    16161616
     1617        // DecrementCount from update count.
     1618        if ( 'themes' === pagenow ) {
     1619            var theme = _.find( _wpThemeSettings.themes, { id: response.slug } );
     1620            if ( theme.hasUpdate ) {
     1621                wp.updates.decrementCount( 'theme' );
     1622            }
     1623        }
     1624
    16171625        wp.a11y.speak( _x( 'Deleted!', 'theme' ) );
    16181626
Note: See TracChangeset for help on using the changeset viewer.