• 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

Viewing 1 replies (of 1 total)
  • Hi,
    There is a glitch in code you are using.

    Below line is absolutely correct:
    $subject = ‘Download for ‘.$postName;
    But this one is wrong:
    Download for ‘.$postName.’
    It must be like:
    ‘Download for ‘.$postName;

    Hope this will solve your problem.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Concatenation Inside a Text Input’ is closed to new replies.