-
Notifications
You must be signed in to change notification settings - Fork 138
Description
To help address concerns around WebP compatibility, we should ensure that WebP images are used by default for the content only in the front end (or "template") context.
Critically, when content is filtered outside this context - for example in REST endpoints and RSS feeds, the original mime type should be used by default (ew can leverage the existing filter here to make this customizable). In addition, core functions like wp_get_attachment_image_url which would be used to generate Open Graph tags should always return the original MIME type unless called in the template context.
Some research is needed on the best approach here to ensure template context is recognized and image replacement works in places like widgets or images placed in FSE headers while feeds and REST endpoints remain unaffected. We can possibly leverage template_redirect to ensure we are in the "right" loop.