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:
scribu 2010-10-19 17:08:32 +00:00
parent 15cda12c28
commit c5520dab32
1 changed files with 1 additions and 1 deletions

View File

@ -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'];