[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 18:38:49 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 flixos90):
@asafm7 Your problem sounds similar to the one that was fixed here in
[55825], but I can't say for sure without having more context. Are you
able to test it on your end?
Basically, adding this to the beginning of the
`wp_get_loading_attr_default()` function in `wp-includes/media.php` should
fix it:
{{{#!php
if ( ( 'the_post_thumbnail' === $context || 'wp_get_attachment_image' ===
$context ) && doing_filter( 'the_content' ) ) {
return false;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58089#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list