]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/post.php
Wordpress 3.5.2
[autoinstalls/wordpress.git] / wp-includes / post.php
index 6e575ea949649333f1146d550c601e94e9d9138f..870bec7a6e93c0b2463efc9fbba41b57f1f5fb8d 100644 (file)
@@ -681,12 +681,9 @@ final class WP_Post {
  * @return array Ancestor IDs or empty array if none are found.
  */
 function get_post_ancestors( $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 );
 
        $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();
                return array();
 
        $ancestors = array();