Make WordPress Core


Ignore:
Timestamp:
06/23/2008 09:50:19 PM (17 years ago)
Author:
ryan
Message:

Don't get post ancestors if post not found. Props Sam_a. fixes #6953

File:
1 edited

Legend:

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

    r8096 r8173  
    171171        if ( ! $_post = wp_cache_get($post, 'posts') ) {
    172172            $_post = & $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post));
     173            if ( ! $_post )
     174                return $null;
    173175            _get_post_ancestors($_post);
    174176            wp_cache_add($_post->ID, $_post, 'posts');
Note: See TracChangeset for help on using the changeset viewer.