mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 23:57:41 +02:00
Merge clear_global_post_cache() into clean_post_cache(). fixes #11744
git-svn-id: http://svn.automattic.com/wordpress/trunk@12768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
89c4e9f15d
commit
42d8102a9c
@ -661,13 +661,10 @@ function get_blog_post( $blog_id, $post_id ) {
|
|||||||
return $post;
|
return $post;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deprecated, see clean_post_cache()
|
||||||
function clear_global_post_cache( $post_id ) {
|
function clear_global_post_cache( $post_id ) {
|
||||||
global $wpdb;
|
return;
|
||||||
|
|
||||||
wp_cache_delete( $wpdb->blogid . '-' . $post_id, 'global-posts' );
|
|
||||||
}
|
}
|
||||||
add_action( 'publish_post', 'clear_global_post_cache' );
|
|
||||||
add_action( 'delete_post', 'clear_global_post_cache' );
|
|
||||||
|
|
||||||
function add_user_to_blog( $blog_id, $user_id, $role ) {
|
function add_user_to_blog( $blog_id, $user_id, $role ) {
|
||||||
switch_to_blog($blog_id);
|
switch_to_blog($blog_id);
|
||||||
|
@ -3672,6 +3672,9 @@ function clean_post_cache($id) {
|
|||||||
foreach( $children as $cid )
|
foreach( $children as $cid )
|
||||||
clean_post_cache( $cid );
|
clean_post_cache( $cid );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( is_multisite() )
|
||||||
|
wp_cache_delete( $wpdb->blogid . '-' . $id, 'global-posts' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user