Don't stomp on posts_per_page in get_posts(). Props bobbyblade. Fixes #15150
git-svn-id: https://develop.svn.wordpress.org/trunk@15852 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
15cda12c28
commit
c5520dab32
@ -1205,7 +1205,7 @@ function get_posts($args = null) {
|
||||
$r = wp_parse_args( $args, $defaults );
|
||||
if ( empty( $r['post_status'] ) )
|
||||
$r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
|
||||
if ( ! empty($r['numberposts']) )
|
||||
if ( ! empty($r['numberposts']) && empty($r['posts_per_page']) )
|
||||
$r['posts_per_page'] = $r['numberposts'];
|
||||
if ( ! empty($r['category']) )
|
||||
$r['cat'] = $r['category'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user