diff --git a/inc/Engine/Optimization/LazyRenderContent/Frontend/Processor/HelperTrait.php b/inc/Engine/Optimization/LazyRenderContent/Frontend/Processor/HelperTrait.php index 8a91d3d97e..38b3c26d76 100644 --- a/inc/Engine/Optimization/LazyRenderContent/Frontend/Processor/HelperTrait.php +++ b/inc/Engine/Optimization/LazyRenderContent/Frontend/Processor/HelperTrait.php @@ -31,7 +31,7 @@ protected function get_processed_tags() { * * @param array|string[] $tags Tags to be processed. */ - return wpm_apply_filters_typed( + $tags = wpm_apply_filters_typed( 'array', 'rocket_lazy_render_content_processed_tags', [ @@ -43,5 +43,10 @@ protected function get_processed_tags() { 'HEADER', ] ); + + /** + * Convert tags to upper case here before + */ + return array_map( 'strtoupper', $tags ); } } diff --git a/tests/Integration/inc/Engine/Optimization/LazyRenderContent/Frontend/Filter/lrcProcessedTagsFilter.php b/tests/Integration/inc/Engine/Optimization/LazyRenderContent/Frontend/Filter/lrcProcessedTagsFilter.php new file mode 100644 index 0000000000..a4f4842422 --- /dev/null +++ b/tests/Integration/inc/Engine/Optimization/LazyRenderContent/Frontend/Filter/lrcProcessedTagsFilter.php @@ -0,0 +1,36 @@ +getMethod( 'get_processed_tags' ); + + $method->setAccessible(true); + $result = $method->invoke( $dom ); + + $expected = [ 'DIV', 'MAIN', 'FOOTER', 'SECTION', 'ARTICLE', 'HEADER', 'H2', 'H1', 'LI' ]; + + $this->assertSame( $expected, $result ); + } +}