**Update:** This is not the right way to do this. Use WordPress functions to sanitize data. April 27, 2012
While I might be showing a bit about my PHP naivety but while working with theme options recently I found that some of my content had a just before a single quote. Now I knew it was working to escape the content but didn’t know how to get that dang out of the content. After reading up a bit more on escaping and data sanitization I found the
function and guess what it does exactly what you’d think.
Remember if you’re going to echo any theme options to call
on it too. So my theme options changed from
echo get_option( theme_option_name );
echo stripslashes( get_option( theme_option_name ) );
And we’ve killed the that were messing us up.