Home Forums General Issues line breaks being lost in textarea


line breaks being lost in textarea

  • I’ve used ACF to add additional fields to users’s profiles, but find that line breaks are being lost — if someone presses “return” one or more times in the input it is as if they hadn’t.

    Has anyone found a way round this?

  • The problem turned out to be that what ACF returns is the raw data for the fields in the form. The answer I went for was to go

    apply_filters('acf_the_content', $usermeta['short_description'][0]);

    (with the actual data having been read intp $usermeta[‘short_description’][0])

    The other route seems to be to force the applying of filters as they are saved — I erred against this as I don’t know why ACF doesn’t do this by default.

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

You must be logged in to reply to this topic.