Make WordPress Core


Ignore:
Timestamp:
09/11/2007 07:54:19 PM (17 years ago)
Author:
ryan
Message:

If a category is already a tag, don't put it in the list of categories to convert. fixes #4955

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/wp-cat2tag.php

    r6079 r6080  
    1717        global $wpdb;
    1818
    19         $this->all_categories = get_categories('get=all');
     19        $categories = get_categories('get=all');
     20        foreach ( $categories as $category ) {
     21            if ( !tag_exists($wpdb->escape($category->name)) )
     22                $this->all_categories[] = $category;   
     23        }
    2024    }
    2125
     
    173177        global $wpdb;
    174178
    175         $this->categories_to_convert = get_categories('fields=ids&get=all');
     179        $this->populate_all_categories();
     180        foreach ( $this->all_categories as $category )
     181            $this->categories_to_convert[] = $category->term_id;
    176182        $this->convert_them();
    177183    }
Note: See TracChangeset for help on using the changeset viewer.