Make WordPress Core

Changeset 7939


Ignore:
Timestamp:
05/16/2008 01:43:35 AM (17 years ago)
Author:
matt
Message:

Use TT ids instead of term ids. Hat tip: andy.

File:
1 edited

Legend:

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

    r7738 r7939  
    13041304        $values = array();
    13051305        $term_order = 0;
    1306         $final_term_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');
    1307         foreach ( $term_ids as $term_id )
    1308             if ( in_array($term_id, $final_term_ids) )
    1309                 $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $term_id, ++$term_order);
     1306        $final_tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');
     1307        foreach ( $tt_ids as $tt_id )
     1308            if ( in_array($tt_id, $final_tt_ids) )
     1309                $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order);
    13101310        if ( $values )
    13111311            $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)");
Note: See TracChangeset for help on using the changeset viewer.