[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 <github-actions@github.com>
This commit is contained in:
Chi-Hsuan Huang 2024-04-09 12:54:39 +08:00 committed by GitHub
parent 8a9eb3a85f
commit 5bb308f486
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Hide coming soon banner from LYS preview frame

View File

@ -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' ) ) {