From 135ca36a69407d25af3ae8b6f739253474221a13 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 27 Sep 2017 09:43:07 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/ajax-actions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 29cac97917..53fd8671d1 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -3463,6 +3463,7 @@ function wp_ajax_update_theme() { $status = array( 'update' => 'theme', 'slug' => $stylesheet, + 'oldVersion' => '', 'newVersion' => '', ); @@ -3471,6 +3472,11 @@ function wp_ajax_update_theme() { 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' ); $current = get_site_transient( 'update_themes' ); @@ -3502,7 +3508,7 @@ function wp_ajax_update_theme() { } $theme = wp_get_theme( $stylesheet ); - if ( $theme->get( 'Version' ) ) { + if ( $theme->exists() ) { $status['newVersion'] = $theme->get( 'Version' ); }