Apologies, this is one of those things that I'm sure I'm missing the forest for the trees and working way too hard on, but I'm stumped.
I have a Multiple Lines field:
line 1
line 2
I'd like to update it programmatically in a PHP function, adding a newline character and some text, to get this result:
line 1
line 2
line 3
update_post_meta strips backslashes, resulting in:
line 1
line 2nline 3
How do I do this correctly?
Found this info:
PHP will only evaluate escape sequences if the string is enclosed in double quotes. If you use '\n', PHP will just take that as a literal string. If you use "\n", PHP will parse the string for variables and escape sequences and print a new line like you are expecting.
So, there it is.