| @@ -226,9 +226,9 @@ | ||
| 226 | 226 | $html = preg_replace('/<script\b[^>]*>[\s\S]*?<\/script>/i', '', $html); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | if (!empty($scripts)) { |
| 230 | - if (wp_doing_ajax() || (defined('REST_REQUEST') && REST_REQUEST) || did_action('wp_footer')) { | |
| 230 | + if (wp_doing_ajax() || (defined('REST_REQUEST') && REST_REQUEST) || did_action('wp_footer') || get_query_var('embed_page') || isset($_GET['embed_page'])) { | |
| 231 | 231 | $html .= "\n" . $scripts; |
| 232 | 232 | } else { |
| 233 | 233 | add_action('wp_footer', function() use ($scripts) { |
| 234 | 234 | echo $scripts; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |