Changeset 20171
- Timestamp:
- 03/12/2012 06:23:48 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r20156 r20171 431 431 $post = get_post($post); 432 432 433 if ( !empty($post->ancestors) ) 433 if ( ! isset( $post->ancestors ) ) 434 _get_post_ancestors( $post ); 435 436 if ( ! empty( $post->ancestors ) ) 434 437 return $post->ancestors; 435 438 … … 4646 4649 return; 4647 4650 4648 $id = $_post->ancestors[] = $_post->post_parent;4651 $id = $_post->ancestors[] = (int) $_post->post_parent; 4649 4652 while ( $ancestor = $wpdb->get_var( $wpdb->prepare("SELECT `post_parent` FROM $wpdb->posts WHERE ID = %d LIMIT 1", $id) ) ) { 4650 4653 // Loop detection: If the ancestor has been seen before, break. 4651 4654 if ( ( $ancestor == $_post->ID ) || in_array($ancestor, $_post->ancestors) ) 4652 4655 break; 4653 $id = $_post->ancestors[] = $ancestor;4656 $id = $_post->ancestors[] = (int) $ancestor; 4654 4657 } 4655 4658 } -
trunk/wp-includes/query.php
r20024 r20171 2672 2672 // Check post status to determine if post should be displayed. 2673 2673 if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) { 2674 $status = get_post_status($this->posts[0] );2674 $status = get_post_status($this->posts[0]->ID); 2675 2675 $post_status_obj = get_post_status_object($status); 2676 2676 //$type = get_post_type($this->posts[0]);
Note: See TracChangeset
for help on using the changeset viewer.