get_site_url() ) ); } /** * Check that we are in an iFrame. * * @return bool */ private static function is_embedding_in_iframe() { return ( // phpcs:disable WordPress.Security.NonceVerification.Recommended -- No nonce needed, we're only checking for a specific screen view. isset( $_GET['iframe'] ) && 'true' === $_GET['iframe'] && ( isset( $_GET['preview'] ) && 'true' === $_GET['preview'] || isset( $_GET['theme_preview'] ) && 'true' === $_GET['theme_preview'] ) // phpcs:enable WordPress.Security.NonceVerification.Recommended ); } /** * Disable `autoplay` shortcode attribute in context of an iframe * Added via `shortcode_atts_video` & `shortcode_atts_audio` in `init` * * @param array $atts The output array of shortcode attributes. * * @return array The output array of shortcode attributes. */ public static function disable_autoplay( $atts ) { return array_merge( $atts, array( 'autoplay' => false ) ); } /** * We don't want search engines to index iframe previews * Added via `wp_head` action in `init` */ public static function noindex() { echo ''; } /** * Make sure all links and forms open in a new window by default * (unless overridden on client-side by JS) * Added via `wp_head` action in `init` */ public static function base_target_blank() { echo ''; } }