WordPress.org

Make WordPress Core

Changeset 23903


Ignore:
Timestamp:
04/04/2013 03:57:46 PM (5 years ago)
Author:
nacin
Message:

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

Merges [23635] to the 3.5 branch.
fixes #23708.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.5/wp-includes/post.php

    r23213 r23903  
    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.