WordPress.org

Make WordPress Core

Changeset 5741


Ignore:
Timestamp:
06/21/2007 03:46:49 PM (14 years ago)
Author:
ryan
Message:

Term count fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r5739 r5741  
    473473        $in_terms = "'" . implode("', '", $terms) . "'";
    474474        $wpdb->query("DELETE FROM $wpdb->term_relationships WHERE object_id = '$object_id' AND term_taxonomy_id IN ($in_terms)");
    475 
    476475        wp_update_term_count($terms, $taxonomy);
    477476    }
     
    702701        $delete_terms = array_diff($old_terms, $tt_ids);
    703702        if ( $delete_terms ) {
    704             $delete_terms = "'" . implode("', '", $delete_terms) . "'";
    705             $wpdb->query("DELETE FROM $wpdb->term_relationships WHERE term_taxonomy_id IN ($delete_terms)");
    706             $wpdb->query("UPDATE $wpdb->term_taxonomy SET count = count - 1 WHERE term_taxonomy_id IN ($delete_terms)");
     703            $in_delete_terms = "'" . implode("', '", $delete_terms) . "'";
     704            $wpdb->query("DELETE FROM $wpdb->term_relationships WHERE term_taxonomy_id IN ($in_delete_terms)");
    707705            wp_update_term_count($delete_terms, $taxonomy);
    708706        }
Note: See TracChangeset for help on using the changeset viewer.