WordPress.org

Ready to get started?Download WordPress

Forums

update_options (2 posts)

  1. nateomedia
    Member
    Posted 8 years ago #

    In the plugin I'm writing, I have an admin option that should be able to take a string enclosed in quotation marks. However, the quotation marks are being turned into backslashes. Obviously, it's some sort of escape character issue, but even if I insert an backslash before the quotation mark, it still gets removed.

    I'm assuming this has something to do with how update_options works. I've briefly looked at how the function works, but I was hoping someone might of encountered this before and know how to circumvent it.

    Suggestions?

  2. Mark Jaquith
    WordPress Lead Dev
    Posted 8 years ago #

    GPC is automatically slashed by WP. Use stripslashes() before updating the option, because update_option() will try to add slashes again.

Topic Closed

This topic has been closed to new replies.

About this Topic