@@ -1388,7 +1388,7 @@ public static function filter_admin_bar_script_loader_tag( $tag, $handle ) {
13881388 */
13891389 public static function ensure_required_markup ( Document $ dom , $ script_handles = [] ) {
13901390 // Gather all links.
1391- $ links = [
1391+ $ links = [
13921392 Attribute::REL_PRECONNECT => [
13931393 // Include preconnect link for AMP CDN for browsers that don't support preload.
13941394 AMP_DOM_Utils::create_node (
@@ -1403,6 +1403,7 @@ public static function ensure_required_markup( Document $dom, $script_handles =
14031403 ];
14041404
14051405 $ link_elements = $ dom ->head ->getElementsByTagName ( Tag::LINK );
1406+
14061407 /**
14071408 * Link element.
14081409 *
@@ -2095,10 +2096,6 @@ private static function get_optimizer( $args ) {
20952096 private static function get_optimizer_configuration ( $ args ) {
20962097 $ transformers = Optimizer \Configuration::DEFAULT_TRANSFORMERS ;
20972098
2098- $ enable_esm = array_key_exists ( ConfigurationArgument::ENABLE_ESM , $ args )
2099- ? $ args [ ConfigurationArgument::ENABLE_ESM ]
2100- : true ;
2101-
21022099 $ enable_ssr = array_key_exists ( ConfigurationArgument::ENABLE_SSR , $ args )
21032100 ? $ args [ ConfigurationArgument::ENABLE_SSR ]
21042101 : true ;
@@ -2112,15 +2109,6 @@ private static function get_optimizer_configuration( $args ) {
21122109 */
21132110 $ enable_ssr = apply_filters ( 'amp_enable_ssr ' , $ enable_ssr );
21142111
2115- /**
2116- * Filter whether the AMP Optimizer should use ES modules for the runtime and extensions.
2117- *
2118- * @since 2.1.0
2119- *
2120- * @param bool $enable_esm Whether the AMP Optimizer should use ES modules for the runtime and extensions.
2121- */
2122- $ enable_esm = apply_filters ( 'amp_enable_esm ' , $ enable_esm );
2123-
21242112 // In debugging mode, we don't use server-side rendering, as it further obfuscates the HTML markup.
21252113 if ( ! $ enable_ssr ) {
21262114 $ transformers = array_diff (
@@ -2151,9 +2139,6 @@ private static function get_optimizer_configuration( $args ) {
21512139 Optimizer \Transformer \PreloadHeroImage::class => [
21522140 Optimizer \Configuration \PreloadHeroImageConfiguration::INLINE_STYLE_BACKUP_ATTRIBUTE => 'data-amp-original-style ' ,
21532141 ],
2154- Optimizer \Transformer \RewriteAmpUrls::class => [
2155- Optimizer \Configuration \RewriteAmpUrlsConfiguration::ESM_MODULES_ENABLED => $ enable_esm ,
2156- ],
21572142 ],
21582143 $ args
21592144 )
0 commit comments