diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index bd48ebe652..e6f9881d05 100644
|
|
|
3202 | 3202 | } |
3203 | 3203 | |
3204 | 3204 | // Prevent loading a non-active theme preview when there is a drafted/scheduled changeset. |
3205 | | if ( panel.canSwitchTheme( slug ) ) { |
| 3205 | if ( ! panel.canSwitchTheme( slug ) ) { |
3206 | 3206 | deferred.reject({ |
3207 | 3207 | errorCode: 'theme_switch_unavailable' |
3208 | 3208 | }); |
… |
… |
|
3299 | 3299 | |
3300 | 3300 | // Prevent loading a non-active theme preview when there is a drafted/scheduled changeset. |
3301 | 3301 | if ( ! panel.canSwitchTheme( themeId ) ) { |
3302 | | return deferred.reject().promise(); |
| 3302 | deferred.reject({ |
| 3303 | errorCode: 'theme_switch_unavailable' |
| 3304 | }); |
| 3305 | return deferred.promise(); |
3303 | 3306 | } |
3304 | 3307 | |
3305 | 3308 | urlParser = document.createElement( 'a' ); |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index 607349b04a..e1f6d566b2 100644
|
|
final class WP_Customize_Manager { |
5446 | 5446 | $theme->id = $theme->slug; |
5447 | 5447 | $theme->screenshot = array( $theme->screenshot_url ); |
5448 | 5448 | $theme->authorAndUri = $theme->author; |
5449 | | $theme->parent = ( $theme->slug === $theme->template ) ? false : $theme->template; // The .org API does not seem to return the parent in a documented way; however, this check should yield a similar result in most cases. |
| 5449 | // The .org API can return the full parent theme details if passed the 'parent' arg, or if passed the 'template' option it'll return that in the event it's a child theme. |
| 5450 | if ( isset( $theme->parent ) ) { |
| 5451 | $theme->parent = $theme->parent->slug; |
| 5452 | } else { |
| 5453 | $theme->parent = false; |
| 5454 | } |
5450 | 5455 | unset( $theme->slug ); |
5451 | 5456 | unset( $theme->screenshot_url ); |
5452 | 5457 | unset( $theme->author ); |