[wp-trac] [WordPress Trac] #60608: Missing REST API users endpoint orderby parameters
WordPress Trac
noreply at wordpress.org
Thu Feb 22 17:46:52 UTC 2024
#60608: Missing REST API users endpoint orderby parameters
----------------------------+------------------------------
Reporter: helgatheviking | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
----------------------------+------------------------------
Changes (by swissspidy):
* type: defect (bug) => enhancement
* component: General => REST API
Old description:
> [Allowed orderby params in users endpoint](https://github.com/WordPress
> /wordpress-develop/blob/4a3240eb8f4be840ad495302d66f2329d0827179/src/wp-
> includes/rest-api/endpoints/class-wp-rest-users-
> controller.php#L1548-L1555)
>
> compared to
>
> [Supported orderby params in
> `WP_Users_Query`](https://github.com/WordPress/wordpress-
> develop/blob/4a3240eb8f4be840ad495302d66f2329d0827179/src/wp-includes
> /class-wp-user-query.php#L194-L209)
>
> The rest endpoint is missing support for ordering by
> - 'user_login' (or 'login')
> - 'post_count'
> - 'meta_value',
> - 'meta_value_num'
> - 'login__in'
>
> I don't know how complex the meta would be, nor do I fully understand
> what `login__in` actually does, but for sure the endpoint is missing the
> ability to order by the user's login/username which can be different from
> the nicename.
New description:
[https://github.com/WordPress/wordpress-
develop/blob/4a3240eb8f4be840ad495302d66f2329d0827179/src/wp-includes
/rest-api/endpoints/class-wp-rest-users-controller.php#L1548-L1555 Allowed
orderby params in users endpoint]
compared to
[https://github.com/WordPress/wordpress-
develop/blob/4a3240eb8f4be840ad495302d66f2329d0827179/src/wp-includes
/class-wp-user-query.php#L194-L209 Supported orderby params in
`WP_Users_Query`]
The rest endpoint is missing support for ordering by
- 'user_login' (or 'login')
- 'post_count'
- 'meta_value',
- 'meta_value_num'
- 'login__in'
I don't know how complex the meta would be, nor do I fully understand what
`login__in` actually does, but for sure the endpoint is missing the
ability to order by the user's login/username which can be different from
the nicename.
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60608#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list