From 5bb308f486bb46be3d8b3d43a21b9eaa312fdf2b Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Tue, 9 Apr 2024 12:54:39 +0800 Subject: [PATCH] [LYS] Hide coming soon banner from preview frame (#46321) * Hide coming soon banner from preview frame * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- .../changelog/46321-update-hide-banner-from-preview | 4 ++++ plugins/woocommerce/src/Admin/Features/LaunchYourStore.php | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 plugins/woocommerce/changelog/46321-update-hide-banner-from-preview diff --git a/plugins/woocommerce/changelog/46321-update-hide-banner-from-preview b/plugins/woocommerce/changelog/46321-update-hide-banner-from-preview new file mode 100644 index 00000000000..4cb9f0fe9f9 --- /dev/null +++ b/plugins/woocommerce/changelog/46321-update-hide-banner-from-preview @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Hide coming soon banner from LYS preview frame \ No newline at end of file diff --git a/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php b/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php index c76a845be81..09ca19607df 100644 --- a/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php +++ b/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php @@ -230,6 +230,11 @@ class LaunchYourStore { * - 'woocommerce_coming_soon' option value must be 'yes' */ public function maybe_add_coming_soon_banner_on_frontend() { + // Do not show the banner if the site is being previewed. + if ( isset( $_GET['site-preview'] ) ) { // @phpcs:ignore + return false; + } + // User must be an admin or editor. // phpcs:ignore if ( ! current_user_can( 'shop_manager' ) && ! current_user_can( 'administrator' ) ) {