Honestly the best solution is a ‘code’ field type in ACF. The stripslashes_deep() that runs on text fields and textareas is important. Having a field where it is assumed that code is entered and input is stored *as-is* would make the most sense. It should probably come with a disclaimer, but a lot of us need it.
Just a quick update. The issue is that line 188 in _functions.php. A lot of us need a way to disable that action for certain fields.
For now I am commenting out that line on a production site and I’d like to get away from this.
I’ve been mulling over a temporary solution. One options page with a repeater which allows the user to define and order elements, then on a second options page use the PHP export to create the single item’s fields and register them inside a loop populated by the repeater.
It’s a bit complex but until repeaters can collapse it’s something I’ll have to do. I have repeaters where each item has a dozen or more subfields. It’s too hard for users to drag and drop each item.
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!