mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
get_posts fixes from DD32 and filosofo. see #6772
git-svn-id: https://develop.svn.wordpress.org/trunk@7892 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -408,10 +408,12 @@ function get_posts($args = null) {
|
||||
'order' => 'DESC', 'include' => '',
|
||||
'exclude' => '', 'meta_key' => '',
|
||||
'meta_value' =>'', 'post_type' => 'post',
|
||||
'post_status' => 'publish', 'post_parent' => 0
|
||||
'post_parent' => 0
|
||||
);
|
||||
|
||||
$r = wp_parse_args( $args, $defaults );
|
||||
if ( empty( $r['post_status'] ) )
|
||||
$r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
|
||||
if ( ! empty($r['numberposts']) )
|
||||
$r['posts_per_page'] = $r['numberposts'];
|
||||
if ( ! empty($r['category']) )
|
||||
|
||||
Reference in New Issue
Block a user