Convert taxonomy children cache into a transient. fixes #11866

git-svn-id: http://svn.automattic.com/wordpress/trunk@12693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-01-11 18:53:52 +00:00
parent ffe9beca1d
commit 30181fd9ea

View File

@ -1908,7 +1908,7 @@ function clean_term_cache($ids, $taxonomy = '') {
$cleaned[$taxonomy] = true; $cleaned[$taxonomy] = true;
wp_cache_delete('all_ids', $taxonomy); wp_cache_delete('all_ids', $taxonomy);
wp_cache_delete('get', $taxonomy); wp_cache_delete('get', $taxonomy);
delete_option("{$taxonomy}_children"); delete_transient("{$taxonomy}_children");
do_action('clean_term_cache', $ids, $taxonomy); do_action('clean_term_cache', $ids, $taxonomy);
} }
@ -2047,7 +2047,7 @@ function update_term_cache($terms, $taxonomy = '') {
function _get_term_hierarchy($taxonomy) { function _get_term_hierarchy($taxonomy) {
if ( !is_taxonomy_hierarchical($taxonomy) ) if ( !is_taxonomy_hierarchical($taxonomy) )
return array(); return array();
$children = get_option("{$taxonomy}_children"); $children = get_transient("{$taxonomy}_children");
if ( is_array($children) ) if ( is_array($children) )
return $children; return $children;
@ -2057,7 +2057,7 @@ function _get_term_hierarchy($taxonomy) {
if ( $term->parent > 0 ) if ( $term->parent > 0 )
$children[$term->parent][] = $term->term_id; $children[$term->parent][] = $term->term_id;
} }
update_option("{$taxonomy}_children", $children); set_transient("{$taxonomy}_children", $children);
return $children; return $children;
} }