[wp-trac] [WordPress Trac] #58089: Featured images within post content cause lazy-loading logic to apply incorrectly

WordPress Trac noreply at wordpress.org
Wed May 24 17:38:57 UTC 2023


#58089: Featured images within post content cause lazy-loading logic to apply
incorrectly
-------------------------------------------------+-------------------------
 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 needs-dev-  |     Focuses:
  note                                           |  performance
-------------------------------------------------+-------------------------

Comment (by asafm7):

 @flixos90 I think it is the issue I'm encountering, but I want to be sure.

 I have a Cover block set to display the featured image inside a Single
 Product block template. It is being lazy-loaded, although it shouldn't be.

 I've tested, and the problem is here on media.php. 'lazy' is returned
 either because we're not on in the loop, or it isn't the main query:


 {{{
                 if ( is_admin() || ! in_the_loop() || ! is_main_query() )
 {
                         return 'lazy';
                 }
 }}}

 Will your fix address this issue?

 Thanks

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


More information about the wp-trac mailing list