Skip to content

Commit 97b2e07

Browse files
committed
add fetch priority for lazyload bypassed images to improve lcp
1 parent eaddf82 commit 97b2e07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

inc/tag_replacer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public function regular_tag_replace( $new_tag, $original_url, $new_url, $optml_a
332332
}
333333
}
334334
// If the image is between the first images we add the fetchpriority attribute to improve the LCP.
335-
if ( Optml_Tag_Replacer::$lazyload_skipped_images < self::get_skip_lazyload_limit() ) {
335+
if ( self::$lazyload_skipped_images < Optml_Lazyload_Replacer::get_skip_lazyload_limit() ) {
336336
if ( strpos( $new_tag, 'fetchpriority=' ) === false ) {
337337
$new_tag = preg_replace( '/<img/im', $is_slashed ? '<img fetchpriority=\"high\"' : '<img fetchpriority="high"', $new_tag );
338338
}

0 commit comments

Comments
 (0)