#57490 closed defect (bug) (fixed)
Cannot control lazy-loading behavior on a featured image
Reported by: | flixos90 | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | 5.5 |
Component: | Media | Keywords: | has-patch has-unit-tests add-to-field-guide |
Focuses: | performance | Cc: |
Description
When lazy-loading was introduced in WordPress 5.5, one crucial customization point that was omitted (by accident) is checking whether lazy-loading is enabled for a featured image.
As first reported in https://github.com/WordPress/gutenberg/issues/46789, this means that it is impossible to control or remove loading="lazy"
attributes added to featured images.
The Gutenberg issue also refers to other problems some of which are subject of #56930, but technically those problems are separate from this one.
Change History (6)
This ticket was mentioned in PR #3857 on WordPress/wordpress-develop by @flixos90.
2 years ago
#1
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
#2
@
2 years ago
@adamsilverstein @joemcgill @mukesh27 Could you maybe take a look at this? The fix is pretty straightforward.
@flixos90 commented on PR #3857:
2 years ago
#3
@joemcgill Fair point, it may be (or have been) a good idea to call wp_lazy_loading_enabled()
in wp_get_loading_attr_default()
, so that consuming code would have only needed to call the latter. However, the second function was only introduced later, and at this point I'm not sure we could make such a change without breaking BC.
@flixos90 commented on PR #3857:
2 years ago
#5
Committed in https://core.trac.wordpress.org/changeset/55093.
Trac ticket: https://core.trac.wordpress.org/ticket/57490