diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 772e66f139..153c319656 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -602,15 +602,18 @@ function themes_api( $action, $args = array() ) { } } - // Back-compat for info/1.2 API, upgrade the theme objects in query_themes to objects. - if ( 'query_themes' === $action ) { - foreach ( $res->themes as $i => $theme ) { - $res->themes[ $i ] = (object) $theme; + if ( ! is_wp_error( $res ) ) { + // Back-compat for info/1.2 API, upgrade the theme objects in query_themes to objects. + if ( 'query_themes' === $action ) { + foreach ( $res->themes as $i => $theme ) { + $res->themes[ $i ] = (object) $theme; + } + } + + // Back-compat for info/1.2 API, downgrade the feature_list result back to an array. + if ( 'feature_list' === $action ) { + $res = (array) $res; } - } - // Back-compat for info/1.2 API, downgrade the feature_list result back to an array. - if ( 'feature_list' === $action ) { - $res = (array) $res; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index c1c1d4f2d9..8a7ebec236 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51600'; +$wp_version = '5.9-alpha-51601'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.