Make WordPress Core


Ignore:
Timestamp:
10/13/2015 02:39:05 AM (9 years 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.