Use cache sets instead of adds. Props andy. fixes #3562

git-svn-id: https://develop.svn.wordpress.org/trunk@4722 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-01-11 22:34:18 +00:00
parent 22094458d9
commit b232f9b7c4
2 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ function get_all_category_ids() {
if ( ! $cat_ids = wp_cache_get('all_category_ids', 'category') ) {
$cat_ids = $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories");
wp_cache_add('all_category_ids', $cat_ids, 'category');
wp_cache_set('all_category_ids', $cat_ids, 'category');
}
return $cat_ids;
@@ -148,7 +148,7 @@ function &get_category(&$category, $output = OBJECT) {
} else {
if ( ! $_category = wp_cache_get($category, 'category') ) {
$_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1");
wp_cache_add($category, $_category, 'category');
wp_cache_set($category, $_category, 'category');
}
}