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.
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 🙂
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.
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
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.