Ticket #23482: 23482.2.patch
File 23482.2.patch, 1.2 KB (added by , 10 years ago) |
---|
-
textpattern-importer.php
40 40 } 41 41 } 42 42 43 if(!function_exists('get_comment_ID')) 44 { 45 /** 46 * Get the comment count for posts. 47 * 48 * @package WordPress 49 * @subpackage Textpattern_Import 50 * 51 * @param int $post_ID Post ID 52 * @return int 53 */ 54 function get_comment_ID($comment_author, $comment_date) 55 { 56 global $wpdb; 57 $comment_author = stripslashes($comment_author); 58 $comment_date = stripslashes($comment_date); 59 return $wpdb->get_var( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) ); 60 } 61 } 62 43 63 if(!function_exists('link_exists')) 44 64 { 45 65 /** … … 426 446 'comment_approved' => $comment_approved); 427 447 $comment = wp_filter_comment($comment); 428 448 429 if ( $cinfo =comment_exists($name, $posted) ) {449 if ( comment_exists($name, $posted) ) { 430 450 // Update comments 431 $comment['comment_ID'] = $cinfo;451 $comment['comment_ID'] = get_comment_ID($name, $posted); 432 452 $ret_id = wp_update_comment($comment); 433 453 } else { 434 454 // Insert comments