mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 04:04:35 +00:00
Some caching cleanups.
git-svn-id: https://develop.svn.wordpress.org/trunk@4631 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -519,10 +519,16 @@ function update_post_cache(&$posts) {
|
||||
}
|
||||
|
||||
function clean_post_cache($id) {
|
||||
global $post_cache, $blog_id;
|
||||
global $post_cache, $post_meta_cache, $category_cache, $blog_id;
|
||||
|
||||
if ( isset( $post_cache[$blog_id][$id] ) )
|
||||
unset( $post_cache[$blog_id][$id] );
|
||||
|
||||
if ( isset ($post_meta_cache[$blog_id][$id] ) )
|
||||
unset( $post_meta_cache[$blog_id][$id] );
|
||||
|
||||
if ( isset( $category_cache[$blog_id][$id]) )
|
||||
unset ( $category_cache[$blog_id][$id] );
|
||||
}
|
||||
|
||||
function update_page_cache(&$pages) {
|
||||
@@ -537,12 +543,15 @@ function update_page_cache(&$pages) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function clean_page_cache($id) {
|
||||
global $page_cache, $blog_id;
|
||||
|
||||
if ( isset( $page_cache[$blog_id][$id] ) )
|
||||
unset( $page_cache[$blog_id][$id] );
|
||||
|
||||
wp_cache_delete($id, 'pages');
|
||||
wp_cache_delete( 'all_page_ids', 'pages' );
|
||||
wp_cache_delete( 'get_pages', 'page' );
|
||||
}
|
||||
|
||||
function update_post_category_cache($post_ids) {
|
||||
@@ -649,6 +658,12 @@ function update_category_cache() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function clean_category_cache($id) {
|
||||
wp_cache_delete($id, 'category');
|
||||
wp_cache_delete('all_category_ids', 'category');
|
||||
wp_cache_delete('get_categories', 'category');
|
||||
}
|
||||
|
||||
/*
|
||||
add_query_arg: Returns a modified querystring by adding
|
||||
a single key & value or an associative array.
|
||||
|
||||
Reference in New Issue
Block a user