diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index 1f85c9cfc5..9e6f0d360a 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -136,7 +136,7 @@ function get_bookmarks($args = '') { $results = $wpdb->get_results($query); $cache[ $key ] = $results; - wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); + wp_cache_add( 'get_bookmarks', $cache, 'bookmark' ); return apply_filters('get_bookmarks', $results, $r); } diff --git a/wp-includes/category.php b/wp-includes/category.php index 7de7c81dd8..b60fd238e7 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -8,7 +8,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_set('all_category_ids', $cat_ids, 'category'); + wp_cache_add('all_category_ids', $cat_ids, 'category'); } return $cat_ids; @@ -139,7 +139,7 @@ function &get_categories($args = '') { reset ( $categories ); $cache[ $key ] = $categories; - wp_cache_set( 'get_categories', $cache, 'category' ); + wp_cache_add( 'get_categories', $cache, 'category' ); $categories = apply_filters('get_categories', $categories, $r); return $categories; @@ -160,7 +160,7 @@ function &get_category(&$category, $output = OBJECT) { $category = (int) $category; if ( ! $_category = wp_cache_get($category, 'category') ) { $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1"); - wp_cache_set($category, $_category, 'category'); + wp_cache_add($category, $_category, 'category'); } } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 8ca5e2742c..d7b2a1ae8d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -229,7 +229,7 @@ function get_option($setting) { if( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values $value = $row->option_value; - wp_cache_set($setting, $value, 'options'); + wp_cache_add($setting, $value, 'options'); } else { // option does not exist, so we must cache its non-existence $notoptions[$setting] = true; wp_cache_set('notoptions', $notoptions, 'options'); @@ -294,7 +294,7 @@ function wp_load_alloptions() { $alloptions = array(); foreach ( (array) $alloptions_db as $o ) $alloptions[$o->option_name] = $o->option_value; - wp_cache_set('alloptions', $alloptions, 'options'); + wp_cache_add('alloptions', $alloptions, 'options'); } return $alloptions; } diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 7b08d99ab7..bf8f275037 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -635,7 +635,7 @@ function get_calendar($initial = true) { ob_end_clean(); echo $output; $cache[ $key ] = $output; - wp_cache_set( 'get_calendar', $cache, 'calendar' ); + wp_cache_add( 'get_calendar', $cache, 'calendar' ); } function delete_get_calendar_cache() { diff --git a/wp-includes/post.php b/wp-includes/post.php index fa08e89ae3..ac0a0fa704 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1012,7 +1012,7 @@ function get_all_page_ids() { if ( ! $page_ids = wp_cache_get('all_page_ids', 'pages') ) { $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'page'"); - wp_cache_set('all_page_ids', $page_ids, 'pages'); + wp_cache_add('all_page_ids', $page_ids, 'pages'); } return $page_ids; @@ -1055,7 +1055,7 @@ function &get_page(&$page, $output = OBJECT) { return get_post($_page, $output); // Potential issue: we're not checking to see if the post_type = 'page' // So all non-'post' posts will get cached as pages. - wp_cache_set($_page->ID, $_page, 'pages'); + wp_cache_add($_page->ID, $_page, 'pages'); } } }