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.

Built from https://develop.svn.wordpress.org/trunk@35114


git-svn-id: http://core.svn.wordpress.org/trunk@35079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-10-13 02:40:24 +00:00
parent 5bb40ab27d
commit c9babc4cdd
2 changed files with 2 additions and 2 deletions

View File

@ -419,7 +419,7 @@ class WP_User_Query {
$this->query_orderby = 'ORDER BY ' . implode( ', ', $orderby_array );
// limit
if ( isset( $qv['number'] ) && $qv['number'] ) {
if ( isset( $qv['number'] ) && $qv['number'] > 0 ) {
if ( $qv['offset'] ) {
$this->query_limit = $wpdb->prepare("LIMIT %d, %d", $qv['offset'], $qv['number']);
} else {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-35113';
$wp_version = '4.4-alpha-35114';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.