Make WordPress Core

Changeset 21627


Ignore:
Timestamp:
08/27/2012 01:13:40 PM (14 years ago)
Author:
ryan
Message:

Return WP_Post from get_adjacent_post(). see #21309

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r21597 r21627  
    11761176        $query_key = 'adjacent_post_' . md5($query);
    11771177        $result = wp_cache_get($query_key, 'counts');
    1178         if ( false !== $result )
     1178        if ( false !== $result ) {
     1179                if ( is_object( $result ) )
     1180                        $result = new WP_Post( $result );
    11791181                return $result;
     1182        }
    11801183
    11811184        $result = $wpdb->get_row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort");
    … …  
    11841187
    11851188        wp_cache_set($query_key, $result, 'counts');
     1189
     1190        if ( is_object( $result ) )
     1191                $result = new WP_Post( $result );
     1192
    11861193        return $result;
    11871194}
Note: See TracChangeset for help on using the changeset viewer.