| 43 | if(!function_exists('get_comment_ID')) |
| 44 | { |
| 45 | /** |
| 46 | * Get the comment ID for a comment based on author and date. |
| 47 | * |
| 48 | * @package WordPress |
| 49 | * @subpackage Textpattern_Import |
| 50 | * |
| 51 | * @global wpdb $wpdb WordPress database abstraction object. |
| 52 | * |
| 53 | * @param string $comment_author Author of the comment |
| 54 | * @param string $comment_date Date of the comment |
| 55 | * @return mixed Comment ID on success. |
| 56 | */ |
| 57 | function get_comment_ID($comment_author, $comment_date) |
| 58 | { |
| 59 | global $wpdb; |
| 60 | $comment_author = stripslashes($comment_author); |
| 61 | $comment_date = stripslashes($comment_date); |
| 62 | return $wpdb->get_var( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) ); |
| 63 | } |
| 64 | } |
| 65 | |