Make WordPress Core

Changeset 4722


Ignore:
Timestamp:
01/11/2007 10:34:18 PM (20 years ago)
Author:
ryan
Message:

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category.php

    r4716 r4722  
    66        if ( ! $cat_ids = wp_cache_get('all_category_ids', 'category') ) {
    77                $cat_ids = $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories");
    8                 wp_cache_add('all_category_ids', $cat_ids, 'category');
     8                wp_cache_set('all_category_ids', $cat_ids, 'category');
    99        }
    1010
    … …  
    149149                if ( ! $_category = wp_cache_get($category, 'category') ) {
    150150                        $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1");
    151                         wp_cache_add($category, $_category, 'category');
     151                        wp_cache_set($category, $_category, 'category');
    152152                }
    153153        }
  • trunk/wp-includes/post.php

    r4682 r4722  
    903903        if ( ! $page_ids = wp_cache_get('all_page_ids', 'pages') ) {
    904904                $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'page'");
    905                 wp_cache_add('all_page_ids', $page_ids, 'pages');
     905                wp_cache_set('all_page_ids', $page_ids, 'pages');
    906906        }
    907907
    … …  
    945945                                // Potential issue: we're not checking to see if the post_type = 'page'
    946946                                // So all non-'post' posts will get cached as pages.
    947                                 wp_cache_add($_page->ID, $_page, 'pages');
     947                                wp_cache_set($_page->ID, $_page, 'pages');
    948948                        }
    949949                }
Note: See TracChangeset for help on using the changeset viewer.