[wp-trac] [WordPress Trac] #58211: Conditionally skip lazy-loading on images before the loop in classic themes

WordPress Trac noreply at wordpress.org
Wed May 24 19:31:49 UTC 2023


#58211: Conditionally skip lazy-loading on images before the loop in classic themes
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  flixos90
     Type:  defect (bug)                         |      Status:  closed
 Priority:  high                                 |   Milestone:  6.3
Component:  Media                                |     Version:  5.9
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests has-        |     Focuses:
  testing-info needs-dev-note                    |  performance
-------------------------------------------------+-------------------------

Comment (by asafm7):

 @flixos90 , looking at the commit, I think the fix doesn't take into
 consideration a Cover block that is set with the featured image as the
 background image, in a block template.

 Am I right?

 The WP_TEMPLATE_PART_AREA_HEADER won't help, as the Cover block isn't
 there

 So, the case will keep returning lazy from:
 {{{
 if ( is_admin() || ! in_the_loop() || ! is_main_query() ) {
     return 'lazy';
 }
 }}}

 As we're not in the loop.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58211#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list