Errr… I’m not quite sure I understand your question. Could you explain what it is that you want to actually do in more detail?
perhaps that’s why I didn’t get any replies 😀
I’m writing a social tagging plugin for WordPress (allows readers to submit their tags for posts). For this I need new tables in the db to store the user submitted tags in. I already have this working, but the tags aren’t stored correctly (can’t use WordPress’ native function to store tags because it needs to go to a different table).
WordPress stores foto’s as foto’s (dutch plural of photo), whereas my plugin stores it as foto\’s. Is there any way to prevent this?
Ah, I see. This is likely a magic_quotes problem.
First, check to see whether or not the incoming tag has the slashes on it, before you stuff it into the database. The reason I say this is that WordPress automatically adds slashes to incoming content. This then gets slashed again when you run it through the database functions (this is called escaping), so you get that extra slash in there.
So, check to see if your incoming tag data from $_GET or $_POST has the slashes already in it. If so, then run it through the PHP stripslashes() function before passing it to the database functions. If you’re using WordPress’ database functions (specifically, the
$wpdb->insert($table, $data)function call), then it will handle sanitizing it properly for you.
- The topic ‘How does wordpress treat tags on insertion?’ is closed to new replies.