post_exists() and comment_exists() fixes. Fixes post duplication during import. Props tott. fixes #8460

git-svn-id: https://develop.svn.wordpress.org/trunk@10722 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-03-05 22:16:29 +00:00
parent a3ff3cdbf2
commit a5740e48a1
2 changed files with 31 additions and 16 deletions

View File

@@ -19,6 +19,9 @@
function comment_exists($comment_author, $comment_date) {
global $wpdb;
$comment_author = stripslashes($comment_author);
$comment_date = stripslashes($comment_date);
return $wpdb->get_var( $wpdb->prepare("SELECT comment_post_ID FROM $wpdb->comments
WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) );
}