From f33c456925adf3bf2ff1ee61e62653f0086d2c28 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Tue, 7 Dec 2021 20:05:27 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@52341 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/theme.php | 1 + src/wp-admin/themes.php | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index ab751689f0..d5c6a549eb 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/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/src/wp-admin/themes.php b/src/wp-admin/themes.php index 9863aa68ae..3ef411bb6c 100644 --- a/src/wp-admin/themes.php +++ b/src/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 { #>