Support » Plugins and Hacks » Update option in the database with html tags

Update option in the database with html tags

  • Hello!
    I’m using the update_option function to update a option in the DB.
    The problem is that the update function have html tag protection or somthing like that so it update the content to the database like that:
    Test<br><span style=\"font-weight: bold;\">Bold</span><br><span style=\"font-style: italic;\">Italic</span><br><span style=\"text-decoration: underline;\">Underline</span><br>
    Instead like this:
    Test<br><span style="font-weight: bold;">Bold</span><br><span style="font-style: italic;">Italic</span><br><span style="text-decoration: underline;">Underline</span><br>

    Please help me, Thanks in advanced.

Viewing 1 replies (of 1 total)
  • I’m assuming that you want to do something with that html code somewhere?

    I have yet to find a way to prevent that function from escaping the quotes, but you could try using the php built-in-function ‘stripslashes()’ to display the html properly anyway, like so:

    $display = '<span style=\"font-weight: bold;\">Bold</span>';//the content
    echo stripslashes($display);

    This will display your content as if the update_option function hadn’t escaped all the quotes.

Viewing 1 replies (of 1 total)
  • The topic ‘Update option in the database with html tags’ is closed to new replies.