Skip to content

Commit 3d1175a

Browse files
committed
Remove extraneous amp_enable_esm filter
1 parent 178e68c commit 3d1175a

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

includes/class-amp-theme-support.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*
@@ -2079,10 +2080,6 @@ private static function get_optimizer( $args ) {
20792080
private static function get_optimizer_configuration( $args ) {
20802081
$transformers = Optimizer\Configuration::DEFAULT_TRANSFORMERS;
20812082

2082-
$enable_esm = array_key_exists( ConfigurationArgument::ENABLE_ESM, $args )
2083-
? $args[ ConfigurationArgument::ENABLE_ESM ]
2084-
: true;
2085-
20862083
$enable_ssr = array_key_exists( ConfigurationArgument::ENABLE_SSR, $args )
20872084
? $args[ ConfigurationArgument::ENABLE_SSR ]
20882085
: true;
@@ -2096,15 +2093,6 @@ private static function get_optimizer_configuration( $args ) {
20962093
*/
20972094
$enable_ssr = apply_filters( 'amp_enable_ssr', $enable_ssr );
20982095

2099-
/**
2100-
* Filter whether the AMP Optimizer should use ES modules for the runtime and extensions.
2101-
*
2102-
* @since 2.1.0
2103-
*
2104-
* @param bool $enable_esm Whether the AMP Optimizer should use ES modules for the runtime and extensions.
2105-
*/
2106-
$enable_esm = apply_filters( 'amp_enable_esm', $enable_esm );
2107-
21082096
// In debugging mode, we don't use server-side rendering, as it further obfuscates the HTML markup.
21092097
if ( ! $enable_ssr ) {
21102098
$transformers = array_diff(
@@ -2135,9 +2123,6 @@ private static function get_optimizer_configuration( $args ) {
21352123
Optimizer\Transformer\PreloadHeroImage::class => [
21362124
Optimizer\Configuration\PreloadHeroImageConfiguration::INLINE_STYLE_BACKUP_ATTRIBUTE => 'data-amp-original-style',
21372125
],
2138-
Optimizer\Transformer\RewriteAmpUrls::class => [
2139-
Optimizer\Configuration\RewriteAmpUrlsConfiguration::ESM_MODULES_ENABLED => $enable_esm,
2140-
],
21412126
],
21422127
$args
21432128
)

0 commit comments

Comments
 (0)