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

Props afragen.
Fixes #40764.

Built from https://develop.svn.wordpress.org/trunk@41611


git-svn-id: http://core.svn.wordpress.org/trunk@41446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2017-09-27 09:44:45 +00:00
parent 95d8b4fa44
commit 2dd83960b9
2 changed files with 8 additions and 2 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' );
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9-alpha-41610'; $wp_version = '4.9-alpha-41611';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.