diff --git a/wp-admin/import/wp-cat2tag.php b/wp-admin/import/wp-cat2tag.php index 6811195768..c703032378 100644 --- a/wp-admin/import/wp-cat2tag.php +++ b/wp-admin/import/wp-cat2tag.php @@ -16,22 +16,27 @@ class WP_Categories_to_Tags { function populate_all_categories() { global $wpdb; - $this->all_categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE (type & ~ " . TAXONOMY_TAG . ") != 0 ORDER BY cat_name ASC"); + $this->all_categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE (type & ~ " . TAXONOMY_TAG . ") != 0 AND category_count > 0 ORDER BY cat_name ASC"); } function welcome() { - print '
' . __('Howdy! This converter allows you to selectively convert existing categories to tags. To get started, check the checkboxes of the categories you wish to be converted, then click the Convert button.') . '
'; - print '' . __('Keep in mind that if you convert a category with child categories, those child categories get their parent setting removed, so they\'re in the root.') . '
'; + $this->populate_all_categories(); - $this->categories_form(); + print '' . __('Howdy! This converter allows you to selectively convert existing categories to tags. To get started, check the checkboxes of the categories you wish to be converted, then click the Convert button.') . '
'; + print '' . __('Keep in mind that if you convert a category with child categories, those child categories get their parent setting removed, so they\'re in the root.') . '
'; + + $this->categories_form(); + } else { + print 'You have no categories to convert!
'; + } print '' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '
'; + + print ''; + + print '