Support » Everything else WordPress » WordPress theme options

  • duffell

    (@duffell)


    Hi,

    Just wondering if anyone knew of a quick fix for an issue I’m having with a textarea within a theme options page.

    When I save the content within a textarea, wordpress seems to add a back slash \ to certain characters. Each time I save an additional slash is added.

    For example if i were to save

    href=”http://google.com” when saved this would appear like href=\”http://google.com\”

    Then wish each additional save the backslashes would duplicate so i could after time end up with href=\\\\\\\\”http://google.com\\\\\\\\”

    The same applies for a few other characters.

    Has anyone encoutered this before ? and if so do you know of a magical cure.

    Thanks

Viewing 1 replies (of 1 total)
  • zenverse

    (@zenverse)

    use stripslashes()

    for example:
    <textarea><?php echo $textarea_content; ?></textarea>

    change it to:
    <textarea><?php echo stripslashes($textarea_content); ?></textarea>

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress theme options’ is closed to new replies.