Make WordPress Core

Ticket #11530: 11530.diff

File 11530.diff, 1.4 KB (added by Denis-de-Bernardy, 15 years ago)
  • wp-includes/taxonomy.php

     
    18601860        $taxonomies = array();
    18611861        // If no taxonomy, assume tt_ids.
    18621862        if ( empty($taxonomy) ) {
    1863                 $tt_ids = implode(', ', $ids);
     1863                $tt_ids = array_map('intval', $ids);
     1864                $tt_ids = implode(', ', $tt_ids);
    18641865                $terms = $wpdb->get_results("SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id IN ($tt_ids)");
     1866                $ids = array();
    18651867                foreach ( (array) $terms as $term ) {
    18661868                        $taxonomies[] = $term->taxonomy;
     1869                        $ids[] = $term->term_id;
    18671870                        wp_cache_delete($term->term_id, $term->taxonomy);
    18681871                }
    18691872                $taxonomies = array_unique($taxonomies);
    18701873        } else {
    1871                 foreach ( $ids as $id ) {
    1872                         wp_cache_delete($id, $taxonomy);
     1874                $taxonomies = array($taxonomy);
     1875                foreach ( $taxonomies as $taxonomy ) {
     1876                        foreach ( $ids as $id ) {
     1877                                wp_cache_delete($id, $taxonomy);
     1878                        }
    18731879                }
    1874                 $taxonomies = array($taxonomy);
    18751880        }
    18761881
    18771882        foreach ( $taxonomies as $taxonomy ) {
     
    18811886                wp_cache_delete('all_ids', $taxonomy);
    18821887                wp_cache_delete('get', $taxonomy);
    18831888                delete_option("{$taxonomy}_children");
     1889                do_action('clean_term_cache', $ids, $taxonomy);
    18841890        }
    18851891
    18861892        wp_cache_set('last_changed', time(), 'terms');
    1887 
    1888         do_action('clean_term_cache', $ids, $taxonomy);
    18891893}
    18901894
    18911895