Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r11971 r12261  
    302302function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
    303303    global $wpdb;
     304    $null = null;
    304305
    305306    if ( empty($term) ) {
     
    322323        if ( ! $_term = wp_cache_get($term, $taxonomy) ) {
    323324            $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %s LIMIT 1", $taxonomy, $term) );
     325            if ( ! $_term )
     326                return $null;
    324327            wp_cache_add($term, $_term, $taxonomy);
    325328        }
     
    15161519    }
    15171520
    1518     do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append);
     1521    do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids);
    15191522    return $tt_ids;
    15201523}
     
    16781681            return new WP_Error('duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug));
    16791682    }
    1680     do_action( 'edit_terms', $alias->term_id );
     1683    do_action( 'edit_terms', $term_id );
    16811684    $wpdb->update($wpdb->terms, compact( 'name', 'slug', 'term_group' ), compact( 'term_id' ) );
    16821685    if ( empty($slug) ) {
     
    16841687        $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );
    16851688    }
    1686     do_action( 'edited_terms', $alias->term_id );
     1689    do_action( 'edited_terms', $term_id );
    16871690
    16881691    $tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id) );
     
    22142217
    22152218    if ( empty($termlink) ) {
    2216         $file = get_option('home') . '/';
     2219        $file = trailingslashit( get_option('home') );
    22172220        $t = get_taxonomy($taxonomy);
    22182221        if ( $t->query_var )
Note: See TracChangeset for help on using the changeset viewer.