Remove count_user_posts as condition of viewing user
-
Currently if a user has no posts you cannot retreive them via GET, e.g. /wp-json/wp/v2/users/2 if user with ID = 2 has no posts.
(see lib/endpoints/class-wp-rest-users-controller.php and search for count_user_posts)
Also, users without posts aren’t included in the results for /wp-json/wp/v2/users
This means if I have a social networking site where two people have signed up, they cannot find each other via the user search if I’m using WP API to get a list of all users on the site.
Having no posts does not mean a user is invalid — checks for such things should be the responsibility of the code I’m writing that uses the API, I don’t need the API restricting my results this way.
(cross-posted to https://github.com/WP-API/WP-API/issues/1983 also)
- The topic ‘Remove count_user_posts as condition of viewing user’ is closed to new replies.