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 ); }