Appearance: Fix a PHP Notice when the update transient isn't available (for example, due to a timeout or being used offline). See #25948

git-svn-id: https://develop.svn.wordpress.org/trunk@26278 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-11-20 01:39:40 +00:00
parent 8da914b9ec
commit 56d0e4ae40

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