From 299bd70ce0406acb454bf36dc53118e673032cff Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 19 Jan 2010 19:45:44 +0000 Subject: [PATCH] Merge clear_global_post_cache() into clean_post_cache(). fixes #11744 git-svn-id: https://develop.svn.wordpress.org/trunk@12768 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/ms-functions.php | 7 ++----- wp-includes/post.php | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 81d36c3c2e..0404478edb 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -661,13 +661,10 @@ function get_blog_post( $blog_id, $post_id ) { return $post; } +// deprecated, see clean_post_cache() function clear_global_post_cache( $post_id ) { - global $wpdb; - - wp_cache_delete( $wpdb->blogid . '-' . $post_id, 'global-posts' ); + return; } -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 ) { switch_to_blog($blog_id); diff --git a/wp-includes/post.php b/wp-includes/post.php index f070bb69c1..c168f36c73 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3672,6 +3672,9 @@ function clean_post_cache($id) { foreach( $children as $cid ) clean_post_cache( $cid ); } + + if ( is_multisite() ) + wp_cache_delete( $wpdb->blogid . '-' . $id, 'global-posts' ); } /**