Ticket #11399: 11399.diff
File 11399.diff, 1.8 KB (added by , 12 years ago) |
---|
-
wp-includes/post.php
557 557 558 558 $post = get_post( $post ); 559 559 560 if ( ! $ancestors = wp_cache_get( $post->ID, 'post_ancestors' ) ) {561 560 $ancestors = array(); 562 561 563 562 if ( !empty( $post->post_parent ) && $post->ID != $post->post_parent ) { … … 572 571 } 573 572 } 574 573 575 wp_cache_add( $post->ID, $ancestors, 'post_ancestors' );576 }577 578 574 return $ancestors; 579 575 } 580 576 … … 2218 2214 2219 2215 clean_post_cache( $post ); 2220 2216 2221 if ( is_post_type_hierarchical( $post->post_type ) ) {2222 foreach ( (array)$children as $child )2217 if ( is_post_type_hierarchical( $post->post_type ) && $children ) { 2218 foreach ( $children as $child ) 2223 2219 clean_post_cache( $child ); 2224 2220 } 2225 2221 … … 4500 4496 wp_cache_delete( 'all_page_ids', 'posts' ); 4501 4497 do_action( 'clean_page_cache', $post->ID ); 4502 4498 } 4503 4504 if ( $children = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_type FROM $wpdb->posts WHERE post_parent = %d", $post->ID) ) ) {4505 foreach ( $children as $child ) {4506 // Loop detection4507 if ( $child->ID == $post->ID )4508 continue;4509 clean_post_cache( $child );4510 }4511 }4512 4499 } 4513 4500 4514 4501 /** -
wp-includes/load.php
410 410 411 411 if ( function_exists( 'wp_cache_add_global_groups' ) ) { 412 412 wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) ); 413 wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' , 'post_ancestors') );413 wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) ); 414 414 } 415 415 } 416 416