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