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.

git-svn-id: https://develop.svn.wordpress.org/trunk@48493 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-07-16 13:17:13 +00:00
parent bd63261888
commit da730fce4d
1 changed files with 11 additions and 9 deletions

View File

@ -94,6 +94,7 @@ class Theme_Upgrader extends WP_Upgrader {
/* translators: %s: Theme error. */
$this->strings['current_theme_has_errors'] = __( 'The current theme has the following error: "%s".' );
if ( ! empty( $this->skin->overwrite ) ) {
if ( 'update-theme' === $this->skin->overwrite ) {
$this->strings['installing_package'] = __( 'Updating the theme…' );
$this->strings['process_failed'] = __( 'Theme update failed.' );
@ -106,6 +107,7 @@ class Theme_Upgrader extends WP_Upgrader {
$this->strings['process_success'] = __( 'Theme downgraded successfully.' );
}
}
}
/**
* Check if a child theme is being installed and we need to install its parent.