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

git-svn-id: https://develop.svn.wordpress.org/trunk@6080 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-09-11 19:54:19 +00:00
parent dc582d68d8
commit e08ead79c9
1 changed files with 8 additions and 2 deletions

View File

@ -16,7 +16,11 @@ class WP_Categories_to_Tags {
function populate_all_categories() {
global $wpdb;
$this->all_categories = get_categories('get=all');
$categories = get_categories('get=all');
foreach ( $categories as $category ) {
if ( !tag_exists($wpdb->escape($category->name)) )
$this->all_categories[] = $category;
}
}
function welcome() {
@ -172,7 +176,9 @@ class WP_Categories_to_Tags {
function convert_all() {
global $wpdb;
$this->categories_to_convert = get_categories('fields=ids&get=all');
$this->populate_all_categories();
foreach ( $this->all_categories as $category )
$this->categories_to_convert[] = $category->term_id;
$this->convert_them();
}