Concatenation Inside a Text Input
-
While writing an email editor, I came across a bit of an issue when trying to add variable names.
When I handball the code in manually (in the php file) like so, it replaces the variable with some text:
$subject = 'Download for '.$postName;
But when I try to add the following text into a text input it displays very differently.
This is how it is written in the text input:
Download for '.$postName.'
Which upon saving, changes it to this:
Download for \'.$postName.\'
Which obviously won’t work.As you can see here, I am retrieving the option for use, but it doesn’t send because it is being reformatted by WP when saving it as an option with update_option:
$subject = get_option('LoadPressEmailEditor_SubjectValue');
Is there any way to:
A) Prevent WP from reformatting this, OR
B) Allow me to add variables in this manner
- The topic ‘Concatenation Inside a Text Input’ is closed to new replies.