Ticket #14485: garyc40-14485-documented.patch
File garyc40-14485-documented.patch, 1.7 KB (added by , 14 years ago) |
---|
-
wp-includes/taxonomy.php
2001 2001 2002 2002 $term_id = apply_filters('term_id_filter', $term_id, $tt_id); 2003 2003 2004 clean_term_cache($term_id, $taxonomy); 2004 $force_clean_taxonomy = ( $parent ) ? true : false; 2005 clean_term_cache($term_id, $taxonomy, true, $force_clean_taxonomy); 2005 2006 2006 2007 do_action("created_term", $term_id, $tt_id, $taxonomy); 2007 2008 do_action("created_$taxonomy", $term_id, $tt_id); … … 2440 2441 * @param int|array $ids Single or list of Term IDs 2441 2442 * @param string $taxonomy Can be empty and will assume tt_ids, else will use for context. 2442 2443 * @param bool $clean_taxonomy Whether to clean taxonomy wide caches (true), or just individual term object caches (false). Default is true. 2444 * @param bool $force_clean_taxonomy Whether to force clean taxonomy wide caches (true), or skip if it's already done (false). Default is false. 2445 * 2443 2446 */ 2444 function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true ) {2447 function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true, $force_clean_taxonomy = false) { 2445 2448 global $wpdb; 2446 2449 static $cleaned = array(); 2447 2450 … … 2471 2474 } 2472 2475 2473 2476 foreach ( $taxonomies as $taxonomy ) { 2474 if ( isset($cleaned[$taxonomy]) )2477 if ( isset($cleaned[$taxonomy]) && ! $force_clean_taxonomy ) 2475 2478 continue; 2476 2479 $cleaned[$taxonomy] = true; 2477 2480 … … 2486 2489 do_action('clean_term_cache', $ids, $taxonomy); 2487 2490 } 2488 2491 2489 wp_cache_set('last_changed', time(), 'terms'); 2492 $last_changed = substr( md5( implode( ',', $ids ) . ':' . time() ), 0, 6 ); 2493 wp_cache_set('last_changed', $last_changed, 'terms'); 2490 2494 }