WordPress.org

Make WordPress Core

Changeset 48493


Ignore:
Timestamp:
07/16/2020 01:17:13 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Check if the theme installer skin's overwrite property exists in Theme_Upgrader::install_strings().

This ensures consistency with Plugin_Upgrader::install_strings() and resolves an issue caused by the property not existing in other upgrader implementations.

Props schlessera, azaozz.
See #50670.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-theme-upgrader.php

    r48455 r48493  
    9595        $this->strings['current_theme_has_errors'] = __( 'The current theme has the following error: "%s".' );
    9696
    97         if ( 'update-theme' === $this->skin->overwrite ) {
    98             $this->strings['installing_package'] = __( 'Updating the theme…' );
    99             $this->strings['process_failed']     = __( 'Theme update failed.' );
    100             $this->strings['process_success']    = __( 'Theme updated successfully.' );
    101         }
    102 
    103         if ( 'downgrade-theme' === $this->skin->overwrite ) {
    104             $this->strings['installing_package'] = __( 'Downgrading the theme…' );
    105             $this->strings['process_failed']     = __( 'Theme downgrade failed.' );
    106             $this->strings['process_success']    = __( 'Theme downgraded successfully.' );
     97        if ( ! empty( $this->skin->overwrite ) ) {
     98            if ( 'update-theme' === $this->skin->overwrite ) {
     99                $this->strings['installing_package'] = __( 'Updating the theme…' );
     100                $this->strings['process_failed']     = __( 'Theme update failed.' );
     101                $this->strings['process_success']    = __( 'Theme updated successfully.' );
     102            }
     103
     104            if ( 'downgrade-theme' === $this->skin->overwrite ) {
     105                $this->strings['installing_package'] = __( 'Downgrading the theme…' );
     106                $this->strings['process_failed']     = __( 'Theme downgrade failed.' );
     107                $this->strings['process_success']    = __( 'Theme downgraded successfully.' );
     108            }
    107109        }
    108110    }
Note: See TracChangeset for help on using the changeset viewer.