WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/13/15 02:39:05 (19 months ago)
Author:
wonderboymusic
Message:

Users: allow -1 (no limit, use with extreme caution on large sites) as the value for number in WP_User_Query - similar to posts_per_page => -1 in WP_Query.

Adds unit tests.

Props mordauk, jesin, nofearinc.
Fixes #28631.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-user-query.php

    r35101 r35114  
    420420 
    421421        // limit 
    422         if ( isset( $qv['number'] ) && $qv['number'] ) { 
     422        if ( isset( $qv['number'] ) && $qv['number'] > 0 ) { 
    423423            if ( $qv['offset'] ) { 
    424424                $this->query_limit = $wpdb->prepare("LIMIT %d, %d", $qv['offset'], $qv['number']); 
Note: See TracChangeset for help on using the changeset viewer.