From 0216b01a69f40a0cc4fa86c9f46f987f64bc8a0e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 2 Dec 2014 01:51:10 +0000 Subject: [PATCH] Ensure the theme and plugin update checks are always in sync with the current theme and plugin versions before fetching cached update data. This change only triggers a request to the update API when necessary. Fixes #13071 Props bswatson git-svn-id: https://develop.svn.wordpress.org/trunk@30696 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/update.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php index 8cba8a7a83..4d62cc82e7 100644 --- a/src/wp-includes/update.php +++ b/src/wp-includes/update.php @@ -521,12 +521,14 @@ function wp_get_update_data() { $counts = array( 'plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0 ); if ( $plugins = current_user_can( 'update_plugins' ) ) { + wp_update_plugins(); // Check for Plugin updates $update_plugins = get_site_transient( 'update_plugins' ); if ( ! empty( $update_plugins->response ) ) $counts['plugins'] = count( $update_plugins->response ); } if ( $themes = current_user_can( 'update_themes' ) ) { + wp_update_themes(); // Check for Theme updates $update_themes = get_site_transient( 'update_themes' ); if ( ! empty( $update_themes->response ) ) $counts['themes'] = count( $update_themes->response );