Ticket #13871: wpcat2tag-importer.php.diff
| File wpcat2tag-importer.php.diff, 1.2 KB (added by , 16 years ago) |
|---|
-
wpcat2tag-importer.php
57 57 $categories = get_categories(array('get' => 'all')); 58 58 foreach ( $categories as $category ) { 59 59 $this->all_categories[] = $category; 60 if ( is_term( $category->slug, 'post_tag' ) )60 if ( term_exists( $category->slug, 'post_tag' ) ) 61 61 $this->hybrids_ids[] = $category->term_id; 62 62 } 63 63 } … … 67 67 $tags = get_terms( array('post_tag'), array('get' => 'all') ); 68 68 foreach ( $tags as $tag ) { 69 69 $this->all_tags[] = $tag; 70 if ( is_term( $tag->slug, 'category' ) )70 if ( term_exists( $tag->slug, 'category' ) ) 71 71 $this->hybrids_ids[] = $tag->term_id; 72 72 } 73 73 } … … 272 272 // If the category is the default, leave category in place and create tag. 273 273 if ( $default_cat == $category->term_id ) { 274 274 275 if ( ! ($id = is_term( $category->slug, 'post_tag' ) ) )275 if ( ! ($id = term_exists( $category->slug, 'post_tag' ) ) ) 276 276 $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); 277 277 278 278 if ( is_wp_error($id) ) {