rebase on oct-10-2023
This commit is contained in:
@@ -48,7 +48,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
public $new_theme_data = array();
|
||||
|
||||
/**
|
||||
* Initialize the upgrade strings.
|
||||
* Initializes the upgrade strings.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
@@ -56,7 +56,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
$this->strings['up_to_date'] = __( 'The theme is at the latest version.' );
|
||||
$this->strings['no_package'] = __( 'Update package not available.' );
|
||||
/* translators: %s: Package URL. */
|
||||
$this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s…' ), '<span class="code">%s</span>' );
|
||||
$this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s…' ), '<span class="code pre">%s</span>' );
|
||||
$this->strings['unpack_package'] = __( 'Unpacking the update…' );
|
||||
$this->strings['remove_old'] = __( 'Removing the old version of the theme…' );
|
||||
$this->strings['remove_old_failed'] = __( 'Could not remove the old theme.' );
|
||||
@@ -65,14 +65,14 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the installation strings.
|
||||
* Initializes the installation strings.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
public function install_strings() {
|
||||
$this->strings['no_package'] = __( 'Installation package not available.' );
|
||||
/* translators: %s: Package URL. */
|
||||
$this->strings['downloading_package'] = sprintf( __( 'Downloading installation package from %s…' ), '<span class="code">%s</span>' );
|
||||
$this->strings['downloading_package'] = sprintf( __( 'Downloading installation package from %s…' ), '<span class="code pre">%s</span>' );
|
||||
$this->strings['unpack_package'] = __( 'Unpacking the package…' );
|
||||
$this->strings['installing_package'] = __( 'Installing the theme…' );
|
||||
$this->strings['remove_old'] = __( 'Removing the old version of the theme…' );
|
||||
@@ -110,7 +110,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a child theme is being installed and we need to install its parent.
|
||||
* Checks if a child theme is being installed and its parent also needs to be installed.
|
||||
*
|
||||
* Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::install().
|
||||
*
|
||||
@@ -278,7 +278,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade a theme.
|
||||
* Upgrades a theme.
|
||||
*
|
||||
* @since 2.8.0
|
||||
* @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
|
||||
@@ -328,9 +328,14 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
'clear_destination' => true,
|
||||
'clear_working' => true,
|
||||
'hook_extra' => array(
|
||||
'theme' => $theme,
|
||||
'type' => 'theme',
|
||||
'action' => 'update',
|
||||
'theme' => $theme,
|
||||
'type' => 'theme',
|
||||
'action' => 'update',
|
||||
'temp_backup' => array(
|
||||
'slug' => $theme,
|
||||
'src' => get_theme_root( $theme ),
|
||||
'dir' => 'themes',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
@@ -346,8 +351,10 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
|
||||
wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
|
||||
|
||||
// Ensure any future auto-update failures trigger a failure email by removing
|
||||
// the last failure notification from the list when themes update successfully.
|
||||
/*
|
||||
* Ensure any future auto-update failures trigger a failure email by removing
|
||||
* the last failure notification from the list when themes update successfully.
|
||||
*/
|
||||
$past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );
|
||||
|
||||
if ( isset( $past_failure_emails[ $theme ] ) ) {
|
||||
@@ -359,7 +366,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade several themes at once.
|
||||
* Upgrades several themes at once.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
|
||||
@@ -443,7 +450,12 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
'clear_working' => true,
|
||||
'is_multi' => true,
|
||||
'hook_extra' => array(
|
||||
'theme' => $theme,
|
||||
'theme' => $theme,
|
||||
'temp_backup' => array(
|
||||
'slug' => $theme,
|
||||
'src' => get_theme_root( $theme ),
|
||||
'dir' => 'themes',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
@@ -477,13 +489,15 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
|
||||
$this->skin->footer();
|
||||
|
||||
// Cleanup our hooks, in case something else does a upgrade on this connection.
|
||||
// Cleanup our hooks, in case something else does an upgrade on this connection.
|
||||
remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );
|
||||
remove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );
|
||||
remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
|
||||
|
||||
// Ensure any future auto-update failures trigger a failure email by removing
|
||||
// the last failure notification from the list when themes update successfully.
|
||||
/*
|
||||
* Ensure any future auto-update failures trigger a failure email by removing
|
||||
* the last failure notification from the list when themes update successfully.
|
||||
*/
|
||||
$past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );
|
||||
|
||||
foreach ( $results as $theme => $result ) {
|
||||
@@ -622,7 +636,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on maintenance mode before attempting to upgrade the active theme.
|
||||
* Turns on maintenance mode before attempting to upgrade the active theme.
|
||||
*
|
||||
* Hooked to the {@see 'upgrader_pre_install'} filter by Theme_Upgrader::upgrade() and
|
||||
* Theme_Upgrader::bulk_upgrade().
|
||||
@@ -654,7 +668,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn off maintenance mode after upgrading the active theme.
|
||||
* Turns off maintenance mode after upgrading the active theme.
|
||||
*
|
||||
* Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::upgrade()
|
||||
* and Theme_Upgrader::bulk_upgrade().
|
||||
@@ -692,7 +706,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the old theme during an upgrade.
|
||||
* Deletes the old theme during an upgrade.
|
||||
*
|
||||
* Hooked to the {@see 'upgrader_clear_destination'} filter by Theme_Upgrader::upgrade()
|
||||
* and Theme_Upgrader::bulk_upgrade().
|
||||
@@ -730,7 +744,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the WP_Theme object for a theme.
|
||||
* Gets the WP_Theme object for a theme.
|
||||
*
|
||||
* @since 2.8.0
|
||||
* @since 3.0.0 The `$theme` argument was added.
|
||||
|
||||
Reference in New Issue
Block a user