Ticket #18609: global_terms_auto_update_replacement.diff
File global_terms_auto_update_replacement.diff, 954 bytes (added by , 11 years ago) |
---|
-
wp-includes/ms-functions.php
1815 1815 if ( get_option( 'default_category' ) == $term_id ) 1816 1816 update_option( 'default_category', $global_id ); 1817 1817 1818 $wpdb->update( $wpdb->terms, array('term_id' => $global_id), array('term_id' => $term_id) ); 1818 $replacement_term = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE term_id = %d", $term_id ), ARRAY_A ); 1819 1820 $wpdb->delete( $wpdb->terms, array('term_id' => $replacement_term['term_id'] ) ); 1821 $replacement_term['term_id'] = $global_id; 1822 $wpdb->insert( $wpdb->terms, $replacement_term ); 1823 1819 1824 $wpdb->update( $wpdb->term_taxonomy, array('term_id' => $global_id), array('term_id' => $term_id) ); 1820 1825 $wpdb->update( $wpdb->term_taxonomy, array('parent' => $global_id), array('parent' => $term_id) ); 1821 1826