Support

Account

Home Forums Front-end Issues WordPress 4.4 responsive images Reply To: WordPress 4.4 responsive images

  • I think it would be possible to parse the HTML from the editor on load and replace the image tag with one that includes srcset, but that seems like a poor solution. In addition to being a pain to code, you probably don’t want a preg_replace running every page load on every WYSIWYG field.

    Hopefully ACF issues an update that will start including srcset in img tags when they are added to the WYSIWYG editor on the admin side.

    Regarding your snippet above, I would return the image ID instead of array whenever possible. Again, per Joe McGill’s recommendation, it will be faster. Not the end of the world, but if possible might as well speed it up.