From 5862ddbd8ffd4c92646565d0487d34c7a44bcf94 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 20 Nov 2013 01:40:09 +0000 Subject: [PATCH] Appearance: Fix a PHP Notice when the update transient isn't available (for example, due to a timeout or being used offline). See #25948 Built from https://develop.svn.wordpress.org/trunk@26278 git-svn-id: http://core.svn.wordpress.org/trunk@26183 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/theme.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 681d0769c3..9415199a78 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -366,12 +366,14 @@ function wp_prepare_themes_for_js( $themes = null ) { $updates = array(); if ( current_user_can( 'update_themes' ) ) { - $updates = get_site_transient( 'update_themes' ); - $updates = $updates->response; + $updates_transient = get_site_transient( 'update_themes' ); + if ( isset( $updates_transient->response ) ) { + $updates = $updates_transient->response; + } } WP_Theme::sort_by_name( $themes ); - foreach( $themes as $slug => $theme ) { + foreach ( $themes as $slug => $theme ) { $parent = false; if ( $theme->parent() ) { $parent = $theme->parent()->display( 'Name' );