It works with ACF 4.x. I had no time to test ACF pro 5. My code was really dirty hack (as I mentioned) so I believe it may not work with new version of ACF. Will try to fix it next week or find better (more elegant) solution with new version of ACF.
Hi,
Since I receive notifications about new posts in this thread and there is no reply from Elliot I decided to share my solution which is probably the only way to fix this problem without editing plugin code. It is extremely dirty hack but it works for me and is still better then editing AFC code. Put it in your functions.php
I attach as zipped .php file because I am affraid that this text field may delete backslashes or something 🙂
Marek
Hi Elliot,
Unfortunately your suggested solution (hook into update_value before core update_value) CANNOT WORK.
Core acf/update_value is action, not filter, So, I may hook but cannot change anything.
_function.php line 26:
add_action(‘acf/update_value’, array($this, ‘update_value’), 5, 3);
You call acf/update_value as filter but later, from inside core acf/update value, AFTER stripslashes_deep.
So there is completely no way to fix this issue without editing your code.
Marek.
Hi Elliot,
Same problem here, and probably in many websites with computer/Internet related content – windows paths, windows registry keys, latex markup, some regular experessions, code snippets with escaping sequences are destroyed if someone uses ACF WYSIWYG to store them.
Not to mention ASCII arts! :-))
Solution mentioned by figureone seems fine for me also.
Any plans for fix in near future?
Thanks in advance
Marek
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.