Make WordPress Core

Changeset 23635


Ignore:
Timestamp:
03/07/2013 06:49:46 AM (12 years ago)
Author:
nacin
Message:

Allow get_post_ancestors() to inspect the $post global, when null/0 is received. see #23708.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r23594 r23635  
    682682 */
    683683function get_post_ancestors( $post ) {
    684     if ( ! $post )
    685         return array();
    686 
    687684    $post = get_post( $post );
    688685
    689     if ( empty( $post->post_parent ) || $post->post_parent == $post->ID )
     686    if ( ! $post || empty( $post->post_parent ) || $post->post_parent == $post->ID )
    690687        return array();
    691688
Note: See TracChangeset for help on using the changeset viewer.