[wp-trac] [WordPress Trac] #56588: WordPress puts "loading=lazy" on first image on archive page - wp_get_loading_attr_default bug

WordPress Trac noreply at wordpress.org
Mon May 22 19:32:40 UTC 2023


#56588: WordPress puts "loading=lazy" on first image on archive page -
wp_get_loading_attr_default bug
--------------------------------------+--------------------------
 Reporter:  salvoaranzulla            |       Owner:  flixos90
     Type:  defect (bug)              |      Status:  assigned
 Priority:  high                      |   Milestone:  6.3
Component:  Media                     |     Version:  5.9
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+--------------------------

Comment (by flixos90):

 @costdev Thanks for the feedback. I took a closer look, and indeed the
 instructions weren't entirely correct. Since blocks are removed from the
 content for the excerpt anyway, this problem is a bit more specific, and
 it applies only to images that are ''not'' part of a block. So this could
 be either legacy content not created with Gutenberg, or content injected
 through a plugin, e.g. a page builder or a plugin that adds some markup to
 each post.

 So the 4th step needs to be clarified to:
 "Create another post with no featured image, but 3 images in its content.
 All of these images should appear outside of blocks."

 An easy way to enforce this behavior even when using the block editor
 would be to add the images as `core/image` blocks as usual, then go into
 the overall "Code Editor" and remove all the block comments for those
 `core/image` blocks so that the editor interprets it as "Classic Editor"
 markup.

 Can you please give it a retry like that? That should see the original
 issue and it being fixed by the PR.

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


More information about the wp-trac mailing list