Changeset 6726 for trunk/wp-admin/import/wp-cat2tag.php
- Timestamp:
- 02/05/2008 06:47:27 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/wp-cat2tag.php
r6551 r6726 1 <?php 1 <?php 2 2 3 3 class WP_Categories_to_Tags { … … 20 20 foreach ( $categories as $category ) { 21 21 if ( !tag_exists($wpdb->escape($category->name)) ) 22 $this->all_categories[] = $category; 22 $this->all_categories[] = $category; 23 23 } 24 24 } … … 54 54 } 55 55 checkflag = 'true'; 56 return '<?php _e('Uncheck All') ?>'; 56 return '<?php _e('Uncheck All') ?>'; 57 57 } else { 58 58 for ( i = 0; i < field.length; i++ ) { … … 61 61 } 62 62 checkflag = 'false'; 63 return '<?php _e('Check All') ?>'; 63 return '<?php _e('Check All') ?>'; 64 64 } 65 65 } … … 77 77 foreach ($this->all_categories as $category) { 78 78 $category = sanitize_term( $category, 'category', 'display' ); 79 79 80 80 if ((int) $category->parent == 0) { 81 81 echo '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>'; … … 165 165 $posts = get_objects_in_term($category->term_id, 'category'); 166 166 foreach ( $posts as $post ) { 167 if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") ) 167 if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") ) 168 168 $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post', '$id')"); 169 169 clean_post_cache($post);
Note: See TracChangeset
for help on using the changeset viewer.