diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 1e4828b3c1..8e98854afc 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -1005,6 +1005,21 @@ function customize_themes_print_templates() { ?> <# } #>

+ <# } else if ( ! data.active && data.blockTheme ) { #> +

+ + <# if ( data.actions.activate ) { #> + activate this theme, and use the Site Editor to customize it.' ), + '{{{ data.actions.activate }}}' + ); + ?> + <# } #> +

<# } #>

{{{ data.description }}}

@@ -1025,10 +1040,20 @@ function customize_themes_print_templates() { <# } #> - <# if ( data.compatibleWP && data.compatiblePHP ) { #> - + <# if ( data.blockTheme ) { #> + + <# if ( data.compatibleWP && data.compatiblePHP && data.actions.activate ) { #> + + <# } #> <# } else { #> - + <# if ( data.compatibleWP && data.compatiblePHP ) { #> + + <# } else { #> + + <# } #> <# } #> <# } else { #> <# if ( data.compatibleWP && data.compatiblePHP ) { #> diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 25d831bb2f..9f74692e7f 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -5808,10 +5808,11 @@ final class WP_Customize_Manager { if ( 'installed' === $theme_action ) { // Load all installed themes from wp_prepare_themes_for_js(). - $themes = array( 'themes' => wp_prepare_themes_for_js() ); - foreach ( $themes['themes'] as &$theme ) { - $theme['type'] = 'installed'; - $theme['active'] = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme['id'] ); + $themes = array( 'themes' => array() ); + foreach ( wp_prepare_themes_for_js() as $theme ) { + $theme['type'] = 'installed'; + $theme['active'] = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme['id'] ); + $themes['themes'][] = $theme; } } elseif ( 'wporg' === $theme_action ) { diff --git a/wp-includes/customize/class-wp-customize-theme-control.php b/wp-includes/customize/class-wp-customize-theme-control.php index a0a705d545..20f867e462 100644 --- a/wp-includes/customize/class-wp-customize-theme-control.php +++ b/wp-includes/customize/class-wp-customize-theme-control.php @@ -242,17 +242,47 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {

<# } else if ( 'installed' === data.theme.type ) { #> -
-

{{ data.theme.name }}

-
- <# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #> - - <# } else { #> - - <# } #> + <# if ( data.theme.blockTheme ) { #> +
+

{{ data.theme.name }}

+
+ <# if ( data.theme.actions.activate ) { #> + + + <# } #> +
-
-

+

+ + <# if ( data.theme.actions.activate ) { #> + activate this theme, and use the Site Editor to customize it.' ), + '{{{ data.theme.actions.activate }}}' + ); + ?> + <# } #> +

+ <# } else { #> +
+

{{ data.theme.name }}

+
+ <# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #> + + <# } else { #> + + <# } #> +
+
+

+ <# } #> <# } else { #>

{{ data.theme.name }}

diff --git a/wp-includes/version.php b/wp-includes/version.php index cf5fb84914..6d6cb89f1b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta2-52370'; +$wp_version = '5.9-beta2-52371'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.