X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/00dbffaf1593b0ac719d98f00839221a9ca52133..refs/tags/wordpress-3.5.2:/wp-includes/post.php diff --git a/wp-includes/post.php b/wp-includes/post.php index 6e575ea9..870bec7a 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -681,12 +681,9 @@ final class WP_Post { * @return array Ancestor IDs or empty array if none are found. */ function get_post_ancestors( $post ) { - if ( ! $post ) - return array(); - $post = get_post( $post ); - if ( empty( $post->post_parent ) || $post->post_parent == $post->ID ) + if ( ! $post || empty( $post->post_parent ) || $post->post_parent == $post->ID ) return array(); $ancestors = array();