From c937101f2779c0ced4c5462cece9a8de06ec882a Mon Sep 17 00:00:00 2001 From: markjaquith Date: Fri, 20 Jul 2012 04:35:51 +0000 Subject: [PATCH] =?UTF-8?q?Clear=20the=20get=5Fpages=20cache=20whenever=20?= =?UTF-8?q?ANY=20hierarchical=20post=20type=20cache=20is=20cleared=20?= =?UTF-8?q?=E2=80=94=20not=20just=20Pages.=20fixes=20#21279?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://core.svn.wordpress.org/trunk@21286 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index ea4f3d6711..ceef94bc6b 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4386,9 +4386,11 @@ function clean_post_cache( $post ) { do_action( 'clean_post_cache', $post->ID, $post ); + if ( is_post_type_hierarchical( $post->post_type ) ) + wp_cache_delete( 'get_pages', 'posts' ); + if ( 'page' == $post->post_type ) { wp_cache_delete( 'all_page_ids', 'posts' ); - wp_cache_delete( 'get_pages', 'posts' ); do_action( 'clean_page_cache', $post->ID ); }