Upgrade/Install: Show new version number when updating a theme on Multisite.

Props afragen.
Fixes #40764.


git-svn-id: https://develop.svn.wordpress.org/trunk@41611 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler 2017-09-27 09:43:07 +00:00
parent 4a6ecbfcd0
commit 135ca36a69
1 changed files with 7 additions and 1 deletions

View File

@ -3463,6 +3463,7 @@ function wp_ajax_update_theme() {
$status = array( $status = array(
'update' => 'theme', 'update' => 'theme',
'slug' => $stylesheet, 'slug' => $stylesheet,
'oldVersion' => '',
'newVersion' => '', 'newVersion' => '',
); );
@ -3471,6 +3472,11 @@ function wp_ajax_update_theme() {
wp_send_json_error( $status ); wp_send_json_error( $status );
} }
$theme = wp_get_theme( $stylesheet );
if ( $theme->exists() ) {
$status['oldVersion'] = $theme->get( 'Version' );
}
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
$current = get_site_transient( 'update_themes' ); $current = get_site_transient( 'update_themes' );
@ -3502,7 +3508,7 @@ function wp_ajax_update_theme() {
} }
$theme = wp_get_theme( $stylesheet ); $theme = wp_get_theme( $stylesheet );
if ( $theme->get( 'Version' ) ) { if ( $theme->exists() ) {
$status['newVersion'] = $theme->get( 'Version' ); $status['newVersion'] = $theme->get( 'Version' );
} }