Changeset 12881 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 01/27/2010 07:42:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r12834 r12881 1868 1868 } 1869 1869 1870 clean_term_cache($terms );1870 clean_term_cache($terms, '', false); 1871 1871 1872 1872 return true; … … 1918 1918 * @param int|array $ids Single or list of Term IDs 1919 1919 * @param string $taxonomy Can be empty and will assume tt_ids, else will use for context. 1920 */ 1921 function clean_term_cache($ids, $taxonomy = '') { 1920 * @param bool $clean_taxonomy Whether to clean taxonomy wide caches (true), or just individual term object caches (false). Default is true. 1921 */ 1922 function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) { 1922 1923 global $wpdb; 1923 1924 static $cleaned = array(); … … 1952 1953 continue; 1953 1954 $cleaned[$taxonomy] = true; 1954 wp_cache_delete('all_ids', $taxonomy); 1955 wp_cache_delete('get', $taxonomy); 1956 delete_transient("{$taxonomy}_children"); 1955 1956 if ( $clean_taxonomy ) { 1957 wp_cache_delete('all_ids', $taxonomy); 1958 wp_cache_delete('get', $taxonomy); 1959 delete_option("{$taxonomy}_children"); 1960 // Regenerate {$taxonomy}_children 1961 _get_term_hierarchy($taxonomy); 1962 } 1963 1957 1964 do_action('clean_term_cache', $ids, $taxonomy); 1958 1965 } … … 2093 2100 if ( !is_taxonomy_hierarchical($taxonomy) ) 2094 2101 return array(); 2095 $children = get_transient("{$taxonomy}_children"); 2102 $children = get_option("{$taxonomy}_children"); 2103 2096 2104 if ( is_array($children) ) 2097 2105 return $children; 2098 2099 2106 $children = array(); 2100 2107 $terms = get_terms($taxonomy, array('get' => 'all', 'orderby' => 'id', 'fields' => 'id=>parent')); … … 2103 2110 $children[$parent][] = $term_id; 2104 2111 } 2105 set_transient("{$taxonomy}_children", $children);2112 update_option("{$taxonomy}_children", $children); 2106 2113 2107 2114 return $children;
Note: See TracChangeset
for help on using the changeset viewer.