Make WordPress Core


Ignore:
Timestamp:
05/05/2008 03:46:32 PM (18 years ago)
Author:
ryan
Message:

get_posts fixes from DD32 and filosofo. see #6772

File:
1 edited

Legend:

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

    r7880 r7892  
    409409        'exclude' => '', 'meta_key' => '',
    410410        'meta_value' =>'', 'post_type' => 'post',
    411         'post_status' => 'publish', 'post_parent' => 0
     411        'post_parent' => 0
    412412    );
    413413
    414414    $r = wp_parse_args( $args, $defaults );
     415    if ( empty( $r['post_status'] ) )
     416        $r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
    415417    if ( ! empty($r['numberposts']) )
    416418        $r['posts_per_page'] = $r['numberposts'];
Note: See TracChangeset for help on using the changeset viewer.