Changeset 21952 for trunk/wp-includes/post.php
- Timestamp:
- 09/22/2012 03:55:02 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.