[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:
parent
8a9eb3a85f
commit
5bb308f486
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: update
|
||||||
|
|
||||||
|
Hide coming soon banner from LYS preview frame
|
|
@ -230,6 +230,11 @@ class LaunchYourStore {
|
||||||
* - 'woocommerce_coming_soon' option value must be 'yes'
|
* - 'woocommerce_coming_soon' option value must be 'yes'
|
||||||
*/
|
*/
|
||||||
public function maybe_add_coming_soon_banner_on_frontend() {
|
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.
|
// User must be an admin or editor.
|
||||||
// phpcs:ignore
|
// phpcs:ignore
|
||||||
if ( ! current_user_can( 'shop_manager' ) && ! current_user_can( 'administrator' ) ) {
|
if ( ! current_user_can( 'shop_manager' ) && ! current_user_can( 'administrator' ) ) {
|
||||||
|
|
Loading…
Reference in New Issue