Home Forums General Issues Keep backslash in textarea and wysiwyg


Keep backslash in textarea and wysiwyg

  • Hello

    I try to save a textarea/wisywig field into a json object.

    Into the acf/update_value hook i encode my value $value = json_encode($value)
    All break line became hello\r\nworld but when i try to decode, all the backslash doesn’t exist.

    I’ve check into the database, and no backslash exist, my value became hellornworld, so it’s removed by acf.

    There a a way to skip the backslash strip ?


  • Ok fixed with $value = addslashes(json_encode($json))

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Keep backslash in textarea and wysiwyg’ is closed to new replies.