Changeset 21952
- Timestamp:
- 09/22/2012 03:55:02 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/load.php
r21715 r21952 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 } -
trunk/wp-includes/post.php
r21948 r21952 558 558 $post = get_post( $post ); 559 559 560 if ( ! $ancestors = wp_cache_get( $post->ID, 'post_ancestors' ) ) {561 560 $ancestors = array(); 562 561 … … 572 571 } 573 572 } 574 575 wp_cache_add( $post->ID, $ancestors, 'post_ancestors' );576 }577 573 578 574 return $ancestors; … … 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 } … … 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
Note: See TracChangeset
for help on using the changeset viewer.