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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.