From 9aba2584bb3e4a7f571652a40a5a233389f4a137 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Tue, 7 Dec 2021 20:07:00 +0000 Subject: [PATCH] Themes: Hide "Live Preview" button for FSE block themes. Currently, the Site Editor does not have a live preview feature for non-activated block themes. This commit is a stop-gate to remove the "Live Preview" button for those themes. It avoids confusing users and avoiding a notification message that doesn't make sense. Props antonvlasenko, costdev, hellofromTonya, kafleg, paaljoachim. Fixes #54578. Built from https://develop.svn.wordpress.org/trunk@52341 git-svn-id: http://core.svn.wordpress.org/trunk@51933 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/theme.php | 1 + wp-admin/themes.php | 12 +++++++----- wp-includes/version.php | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index ab751689f0..d5c6a549eb 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -782,6 +782,7 @@ function wp_prepare_themes_for_js( $themes = null ) { ? wp_nonce_url( admin_url( 'themes.php?action=' . $auto_update_action . '&stylesheet=' . $encoded_slug ), 'updates' ) : null, ), + 'block_theme' => $theme->is_block_theme(), ); } diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 9863aa68ae..3ef411bb6c 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -900,11 +900,13 @@ function wp_theme_auto_update_setting_template() { $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> - - + <# if ( ! data.block_theme ) { #> + + + <# } #> <# } else { #>