At the moment I'm using Postman to hit the endpoints and I have a successful Basic Authentication but so far I'm unable to get all the registered users. My request:
https://example.com/wp-json/wp/v2/users
returns only users that have posts even though I have inserted:
add_filter( 'rest_user_query' , 'custom_rest_user_query' );
function custom_rest_user_query( $prepared_args, $request = null ) {
unset($prepared_args['has_published_posts']);
return $prepared_args;
}
in my functions file. I have also tried applying a filter:
https://example.com/wp-json/wp/v2/users?filter[per_page]=0
But I still get the same result: Only users with posts. I have been banging my head on for days now...
100
for performance reasons. This is good practice outside of the REST API too but it's enforced,-1
will not give you all the results unpaged. It's likely the users you're missing are on page 2 or 3