diff --git a/projects/plugins/wpcomsh/changelog/fix-launch-banner-in-iframe b/projects/plugins/wpcomsh/changelog/fix-launch-banner-in-iframe new file mode 100644 index 0000000000000..3d25f5d5bcb47 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/fix-launch-banner-in-iframe @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Gutenberg 19.9: don't show launch banner when the site is previewed in Appearance -> Design diff --git a/projects/plugins/wpcomsh/private-site/logged-in-banner.php b/projects/plugins/wpcomsh/private-site/logged-in-banner.php index 28bd6cdeb0560..b478ff329c70c 100644 --- a/projects/plugins/wpcomsh/private-site/logged-in-banner.php +++ b/projects/plugins/wpcomsh/private-site/logged-in-banner.php @@ -199,6 +199,11 @@ function show_logged_in_banner() { el.style.display = 'none'; document.addEventListener( 'DOMContentLoaded', function() { + // Don't show the banner if the site is previewed via an iframe. + if ( window.top !== window.self ) { + return; + } + var el = document.querySelector( '#wpcom-launch-banner-wrapper' ); if ( el ) { el.style.display = null;