remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9
);
remove_filter( 'upgrader_source_selection', array
( $this, 'check_package'
) );
remove_filter( 'upgrader_post_install', array
( $this, 'check_parent_theme_filter'
) );
if ( !
$this->result ||
is_wp_error( $this->result
) ) { return $this->result;
} // Refresh the Theme Update information.
wp_clean_themes_cache( $parsed_args['clear_update_cache'
] );
if ( $parsed_args['overwrite_package'
] ) { /** This action is documented in wp-admin/includes/class-plugin-upgrader.php */
do_action( 'upgrader_overwrote_package',
$package,
$this->new_theme_data, 'theme'
);
} return true;
} /**
* Upgrades a theme.
*
* @since 2.8.0
* @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.
*
* @param string $theme The theme slug.
* @param array $args {
* Optional. Other arguments for upgrading a theme. Default empty array.
*
* @type bool $clear_update_cache Whether to clear the update cache if successful.
* Default true.
* }
* @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise.
*/