From f8103ad144f5e5551d02f31a0ae661d42d13dfff Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 15 Sep 2005 23:36:48 +0000 Subject: [PATCH] comment_exists() from skeltoac. fixes #1679 git-svn-id: https://develop.svn.wordpress.org/trunk@2879 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 4939b82848..0a7662a8fa 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -478,7 +478,6 @@ function wp_delete_user($id, $reassign = 'novalue') { return true; } - function post_exists($title, $content = '', $post_date = '') { global $wpdb; @@ -493,6 +492,13 @@ function post_exists($title, $content = '', $post_date = '') { return 0; } +function comment_exists($comment_author, $comment_date) { + global $wpdb; + + return $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments + WHERE comment_author = '$comment_author' AND comment_date = '$comment_date'"); +} + function url_shorten ($url) { $short_url = str_replace('http://', '', stripslashes($url)); $short_url = str_replace('www.', '', $short_url);