Make WordPress Core

Ticket #3562: non-adds.diff

File non-adds.diff, 1.6 KB (added by andy, 19 years ago)
  • wp-includes/category.php

     
    55
    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
    1111        return $cat_ids;
     
    148148        } else {
    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        }
    154154
  • wp-includes/post.php

     
    902902
    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
    908908        return $page_ids;
     
    944944                                        return get_post($_page, $output);
    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                }
    950950        }