WordPress.org

Make WordPress Core

Ticket #15150: post.php.diff

File post.php.diff, 579 bytes (added by bobbyblade, 8 years ago)

post.php get_posts fix

  • wp-includes/post.php

     
    11831183        $r = wp_parse_args( $args, $defaults );
    11841184        if ( empty( $r['post_status'] ) )
    11851185                $r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
    1186         if ( ! empty($r['numberposts']) )
     1186        if ( ! empty($r['numberposts']) && empty($r['posts_per_page']) )
    11871187                $r['posts_per_page'] = $r['numberposts'];
    11881188        if ( ! empty($r['category']) )
    11891189                $r['cat'] = $r['category'];