Why Am I getting an error when I add the number parameter to my WP_User_Query?

I was able to reproduce the error. Here’s what I think is happening.

‘number’ defines the number of users per page, and ‘paged’ tell the query which page to return.

For example:

$args = array('number' => 2, 'paged' => 2)

will return the second page at 2 per page.

If you don’t have a query string set, you’ll get an error because it’s trying to show 2 users from a page that is undefined.

The solution is to leave out the ‘paged’ parameter and let it start on page 1 (the default).

My experience ends here with regard to how to implement pagination, but it looks as if it’s a function of the ‘offset’ parameter like:

'offset' => get_query_var($paged) * $number

(assuming the query var exists)