diff --git a/includes/amp-helper-functions.php b/includes/amp-helper-functions.php index 2ec40b9366d..126ec7fef84 100644 --- a/includes/amp-helper-functions.php +++ b/includes/amp-helper-functions.php @@ -203,8 +203,10 @@ function amp_remove_admin_bar_in_phone_preview() { if ( ! amp_is_dev_mode() || ! is_admin_bar_showing() ) { return; } + + ob_start(); ?> - ', '' ], '', ob_get_clean() ); + wp_print_inline_script_tag( $script, [ 'data-ampdevmode' => true ] ); } /**