Ticket #6265: wpmu-importer.patch
File wpmu-importer.patch, 1.7 KB (added by , 17 years ago) |
---|
-
wp-admin/import/wordpress.php
317 317 $cat_index++; 318 318 } 319 319 320 if ($post_id = post_exists($post_ title, '', $post_date)) {320 if ($post_id = post_exists($post_name, '', $post_date)) { 321 321 echo '<li>'; 322 322 printf(__('Post <i>%s</i> already exists.'), stripslashes($post_title)); 323 323 } else { … … 325 325 // If it has parent, process parent first. 326 326 $post_parent = (int) $post_parent; 327 327 if ($parent = $this->posts_processed[$post_parent]) { 328 if (!$parent[1]) { 328 if (!$parent[1]) { 329 329 $result = $this->process_post($parent[0]); // If not yet, process the parent first. 330 330 if ( is_wp_error( $result ) ) 331 331 return $result; -
wp-admin/includes/post.php
169 169 return $post; 170 170 } 171 171 172 function post_exists($ title, $content = '', $post_date = '') {172 function post_exists($post_name, $content = '', $post_date = '') { 173 173 global $wpdb; 174 174 175 175 if (!empty ($post_date)) 176 176 $post_date = "AND post_date = '$post_date'"; 177 177 178 if (!empty ($ title))179 return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_ title = '$title' $post_date");178 if (!empty ($post_name)) 179 return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$post_name' $post_date"); 180 180 else 181 181 if (!empty ($content)) 182 182 return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_content = '$content' $post_date");