Written by Anonymous
</script> <form name="taglist" id="taglist" action="admin.php?import=wpcat2tag&step=4" method="post"> <p><input type="button" class="button-secondary" value="<?php esc_attr_e('Check All', 'wpcat2tag-importer'); ?>" onclick="this.value=check_all_tagrows()" /> <?php wp_nonce_field('import-cat2tag'); ?></p> <ul style="list-style:none"> <?php foreach ( $this->all_tags as $tag ) { ?> <li><label><input type="checkbox" name="tags_to_convert[]" value="<?php echo intval($tag->term_id); ?>" /> <?php echo esc_attr($tag->name) . ' (' . $tag->count . ')'; ?></label><?php if ( in_array( intval($tag->term_id), $this->hybrids_ids ) ) echo ' <a href="#note"> * </a>'; ?></li> <?php } ?> </ul> <?php if ( ! empty($this->hybrids_ids) ) echo '<p><a name="note"></a>' . __('* This tag is also a category. When converted, all posts associated with the tag will also be in the category.', 'wpcat2tag-importer') . '</p>'; ?> <p class="submit"><input type="submit" name="submit_tags" class="button" value="<?php esc_attr_e('Convert Tags to Categories', 'wpcat2tag-importer'); ?>" /></p> </form> <?php } function _category_children($parent, $hier) { ?> <ul style="list-style:none"> <?php foreach ($hier[$parent->term_id] as $child_id) { $child =& get_category($child_id); ?> <li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($child->term_id); ?>" /> <?php echo $child->name . ' (' . $child->count . ')'; ?></label><?php if ( in_array( intval($child->term_id), $this->hybrids_ids ) ) echo ' <a href="#note"> * </a>'; if ( isset($hier[$child->term_id]) ) $this->_category_children($child, $hier); ?></li> <?php } ?> </ul><?php } function _category_exists($cat_id) { $cat_id = (int) $cat_id; $maybe_exists = category_exists($cat_id); if ( $maybe_exists ) { return true; } else { return false; } } function convert_categories() { global $wpdb; if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) { ?> <div class="narrow"> <p><?php printf(__('Uh, oh. Something didn’t work. Please <a href="%s">try again</a>.', 'wpcat2tag-importer'), 'admin.php?import=wpcat2tag'); ?></p> </div> <?php return; }