[wp-trac] [WordPress Trac] #59352: Inline images inserted in the block editor can erroneously get fetchpriority=high
WordPress Trac
noreply at wordpress.org
Thu Sep 14 22:45:17 UTC 2023
#59352: Inline images inserted in the block editor can erroneously get
fetchpriority=high
--------------------------+-----------------------------
Reporter: westonruter | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Media | Version: 6.3
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: performance
--------------------------+-----------------------------
Comment (by westonruter):
Replying to [comment:1 joemcgill]:
> It seems to me like the real bug here is that an inline style is being
added to control the width of this image instead of updating the width
attribute. This also means that WP is incorrectly creating a `sizes`
attribute based on the width attribute, which is being overridden by the
inline CSS.
Good point. I made a POC plugin to fix up the issue using HTML Tag
Processor:
https://gist.github.com/westonruter/f37f747a57643462b7efe110dd61d91b
To fix this in core, it seems like this would need to be a special case in
`wp_img_tag_add_width_and_height_attr()`, yeah?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59352#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list