Ticket #6836: 6836.4.diff
File 6836.4.diff, 2.5 KB (added by , 17 years ago) |
---|
-
wp-admin/import/wp-cat2tag.php
177 177 } 178 178 179 179 // Change the category to a tag. 180 $wpdb-> query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) );180 $wpdb->update($wpdb->term_taxonomy, array('taxonomy' => 'post_tag'), array('term_id' => $category->term_id, 'taxonomy' => 'category') ); 181 181 182 182 $terms = $wpdb->get_col( $wpdb->prepare("SELECT term_id FROM $wpdb->term_taxonomy WHERE parent = %d AND taxonomy = 'category'", $category->term_id) ); 183 183 foreach ( (array) $terms as $term ) 184 184 clean_category_cache($term); 185 185 186 186 // Set all parents to 0 (root-level) if their parent was the converted tag 187 $wpdb-> query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = %d AND taxonomy = 'category'", $category->term_id) );187 $wpdb->update($wpdb->term_taxonomy, array('parent' => '0'), array('parent' => $category->term_id, 'taxonomy' => 'category') ); 188 188 } 189 189 // Clean the cache 190 190 clean_category_cache($category->term_id); -
wp-admin/includes/template.php
504 504 // catch and repair bad pages 505 505 if ( $page->post_parent == $page->ID ) { 506 506 $page->post_parent = 0; 507 $wpdb-> query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d",$page->ID) );507 $wpdb->update($wpdb->posts, array('post_parent' => '0'), array('ID' => $page->ID) ); 508 508 clean_page_cache( $page->ID ); 509 509 } 510 510 -
wp-admin/update-links.php
36 36 $returns = explode("\n", $body); 37 37 38 38 foreach ($returns as $return) : 39 $time = substr($return, 0, 19); 40 $uri = preg_replace('/(.*?) | (.*?)/', '$2', $return); 41 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_updated = %s WHERE link_url = %s", $time, $uri) ); 39 $link_updated = substr($return, 0, 19); 40 $link_url = preg_replace('/(.*?) | (.*?)/', '$2', $return); 41 42 $wpdb->update( $wpdb->links, compact('link_updated'), compact('link_url') ); 42 43 endforeach; 43 44 } 44 45 ?>