Changeset 15758
- Timestamp:
- 10/08/2010 04:22:14 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r15742 r15758 4020 4020 4021 4021 if ( $children = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d", $id) ) ) { 4022 foreach( $children as $cid ) 4022 foreach ( $children as $cid ) { 4023 // Loop detection 4024 if ( $cid == $id ) 4025 continue; 4023 4026 clean_post_cache( $cid ); 4027 } 4024 4028 } 4025 4029 … … 4326 4330 $id = $_post->ancestors[] = $_post->post_parent; 4327 4331 while ( $ancestor = $wpdb->get_var( $wpdb->prepare("SELECT `post_parent` FROM $wpdb->posts WHERE ID = %d LIMIT 1", $id) ) ) { 4328 if ( $id == $ancestor ) 4332 // Loop detection: If the ancestor has been seen before, break. 4333 if ( ( $ancestor == $_post->ID ) || in_array($ancestor, $_post->ancestors) ) 4329 4334 break; 4330 4335 $id = $_post->ancestors[] = $ancestor;
Note: See TracChangeset
for help on using the changeset viewer.