diff --git a/includes/sanitizers/class-amp-style-sanitizer.php b/includes/sanitizers/class-amp-style-sanitizer.php index a078e12264d..53777bf68fb 100644 --- a/includes/sanitizers/class-amp-style-sanitizer.php +++ b/includes/sanitizers/class-amp-style-sanitizer.php @@ -2898,17 +2898,11 @@ private function finalize_stylesheet_group( $group, $group_config ) { $max_bytes = $group_config['cdata_spec']['max_bytes'] - strlen( $group_config['source_map_comment'] ); $previously_seen_stylesheet_index = []; - $indices_by_stylesheet_element_id = []; foreach ( $this->pending_stylesheets as $pending_stylesheet_index => &$pending_stylesheet ) { if ( $group !== $pending_stylesheet['group'] ) { continue; } - // Keep track of the element IDs for the stylesheets. - if ( $pending_stylesheet['node'] instanceof DOMElement && $pending_stylesheet['node']->hasAttribute( 'id' ) ) { - $indices_by_stylesheet_element_id[ $pending_stylesheet['node']->getAttribute( 'id' ) ] = $pending_stylesheet_index; - } - $stylesheet_parts = []; $original_size = 0; foreach ( $pending_stylesheet['stylesheet'] as $stylesheet_part ) {