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
This commit is contained in:
Dion Hulse 2013-11-20 01:40:09 +00:00
parent 4070cdcf66
commit 5862ddbd8f

View File

@ -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' );