[wp-trac] [WordPress Trac] #44427: Introduce lazy-loading API for media and other elements
WordPress Trac
noreply at wordpress.org
Mon Nov 25 10:13:44 UTC 2019
#44427: Introduce lazy-loading API for media and other elements
--------------------------------------+--------------------------
Reporter: mor10 | Owner: flixos90
Type: feature request | Status: assigned
Priority: normal | Milestone: 5.4
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+--------------------------
Comment (by spacedmonkey):
I made some key changes in
[https://core.trac.wordpress.org/attachment/ticket/44427/44427.6.diff
44427.6.diff]
- Added filter to `widget_text_content` ( Props @westonruter )
- Refactored logic so that all html is change by adding the
`wp_lazy_load_content_media` filter.
- Added `$content` to `wp_lazy_load_content_media` filter for better
context.
- Added `smilies_html` filter.
- Added `wp_get_attachment_image` filter.
I know it more expensive ( from a compute standard point ) to run the
regex in all these places, how, I think the added control for developers
to be able to unhook these filters, is a great trade off.
Adding a filter to `wp_get_attachment_image` also fixes
[https://core.trac.wordpress.org/ticket/27399 #27399].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44427#comment:53>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list