Ticket #11354: wordpress-importer.patch
File wordpress-importer.patch, 1.3 KB (added by , 14 years ago) |
---|
-
.php
old new 290 290 function process_categories() { 291 291 global $wpdb; 292 292 293 $cat_names = (array) get_terms('category', 'fields=names'); 293 if ( !is_array( $this->categories ) ) 294 return; 294 295 295 296 while ( $c = array_shift($this->categories) ) { 296 297 $cat_name = trim($this->get_tag( $c, 'wp:cat_name' )); 297 298 298 299 // If the category exists we leave it alone 299 if ( in_array($cat_name, $cat_names) ) 300 $cat_id = (int) category_exists( $cat_name ); 301 if ( 0 < $cat_id ) { 300 302 continue; 303 } 301 304 302 305 $category_nicename = $this->get_tag( $c, 'wp:category_nicename' ); 303 306 $category_description = $this->get_tag( $c, 'wp:category_description' ); … … 320 323 function process_tags() { 321 324 global $wpdb; 322 325 323 $tag_names = (array) get_terms('post_tag', 'fields=names'); 326 if ( !is_array( $this->tags ) ) 327 return; 324 328 325 329 while ( $c = array_shift($this->tags) ) { 326 330 $tag_name = trim($this->get_tag( $c, 'wp:tag_name' )); 327 331 328 // If the categoryexists we leave it alone329 if ( i n_array($tag_name, $tag_names) )332 // If the tag exists we leave it alone 333 if ( is_term( $tag_name, 'post_tag' ) ) { 330 334 continue; 335 } 331 336 332 337 $slug = $this->get_tag( $c, 'wp:tag_slug' ); 333 338 $description = $this->get_tag( $c, 'wp:tag_description' );