Don't stomp on posts_per_page in get_posts(). Props bobbyblade. Fixes #15150

git-svn-id: http://svn.automattic.com/wordpress/trunk@15852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-10-19 17:08:32 +00:00
parent c4599ec729
commit 10532b9345
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'];