I notice there was a somewhat recent discussion about this issue at http://support.advancedcustomfields.com/forums/topic/regression-backslashes-stripped-in-wysiwyg/. Wanted to follow up and see if there’s a fix yet. I’m trying to replace single line breaks with a double line break on a particular field. I’m hooking into acf/save post and using a preg_replace like
if(isset($fields['field_526ec2b23ade3'])) {
$meta = preg_replace('~(?<=.)\n(?=.)~', '\\n\\n', $fields['field_526ec2b23ade3']);
update_field( 'field_526ec2b23ade3', wp_slash($meta), $id );
}
I’ve tried using wp_slash() as suggested at http://codex.wordpress.org/Function_Reference/update_post_meta, but the slashes are still getting removed, the saved post meta just contains two “n”s. Any suggestions?
Hi @mindshare
Currently, you will need to edit the update_value function found in:
‘core/fields/_functions.php’ on line 188 and just comment out the stripslashes code.
I have not yet found a solution for this so please bare with me especially as it is the end of the year and holidays will prevent ACF dev work for a few weeks.
Thanks
E
This reply has been marked as private.