Following the addition of responsive images support in WordPress 4.4, there has been a lot of confusion over what WordPress does "automatically" and what is left up to the developer. I've gathered the following notes from chatting with members of the core team and also my own investigation of the 4.4 source. Here's what I've discovered:
-
Following the 4.4 update, WordPress automatically serves the following images responsively:
- Content images added via the main content editor will now be served with
srcset
markup. This is accomplished by filteringthe_content()
prior to display, which means it applies to existing posts and new posts going forward. - Featured images called by
the_post_thumbnail()
also getsrcset
markup without any additional steps required.
- Content images added via the main content editor will now be served with
-
Images that are referenced from custom fields will not be served responsively unless the theme calls the image via
wp_get_attachment_image()
OR constructst the responsive m