Support » Plugins » Hacks » Unescaping data?

  • Hello all, time for my second problem. Probably a simple one and one I’ve encountered before in non-wordpress situations, but I can’t seem to figure it out this time…
    I wpdb->escape all my data before I insert it into the database, and obviously this adds some \’s in front of each quote and so on. However, obviously I’ll also need to remove these once displaying the data again.
    I can’t seem to figure out if there’s a recommended way within wordpress for this. Is there, and if so, which?
    All I seem to find is people saying you don’t need to this anymore with wordpress, yet I seem to be needing to? Am I doing something wrong?
    Thanks in advance 🙂

Viewing 1 replies (of 1 total)
  • Use $wpdb->prepare() to insert data. To unescape, probably stripslashes_deep() though a lot of buit in WordPress functions handle that for you. Also, there are a lot of nifty functions in wp-includes/formatting.php

Viewing 1 replies (of 1 total)
  • The topic ‘Unescaping data?’ is closed to new replies.