Make WordPress Core


Ignore:
Timestamp:
04/12/2007 02:27:12 AM (18 years ago)
Author:
ryan
Message:

Actually make use of wp_cache_add to avoid unnecessary cache writes. Props skeltoac. fixes #4138

File:
1 edited

Legend:

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

    r5244 r5248  
    10131013    if ( ! $page_ids = wp_cache_get('all_page_ids', 'pages') ) {
    10141014        $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'page'");
    1015         wp_cache_set('all_page_ids', $page_ids, 'pages');
     1015        wp_cache_add('all_page_ids', $page_ids, 'pages');
    10161016    }
    10171017
     
    10561056                // Potential issue: we're not checking to see if the post_type = 'page'
    10571057                // So all non-'post' posts will get cached as pages.
    1058                 wp_cache_set($_page->ID, $_page, 'pages');
     1058                wp_cache_add($_page->ID, $_page, 'pages');
    10591059            }
    10601060        }
Note: See TracChangeset for help on using the changeset viewer.