#58412 closed enhancement (wontfix)
Allowing rand orderby value for post query params
| Reported by: | vrishabhsk | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | REST API | Version: | 4.7 |
| Severity: | normal | Keywords: | dev-feedback has-patch |
| Cc: | Focuses: | performance |
Description
I need to add 'rand' in the enums of the $query_params of 'orderby' key In order to implement this feature - https://github.com/WordPress/gutenberg/issues/40481 in Gutenberg.
Change History (3)
This ticket was mentioned in PR #4513 on WordPress/wordpress-develop by Vrishabhsk.
3 years ago
#1
- Keywords has-patch added
#2
@
3 years ago
- Focuses performance added; rest-api removed
- Milestone Awaiting Review
- Resolution → wontfix
- Status new → closed
- Version trunk → 4.7
Hi @vrishabhsk,
Thanks for the ticket and welcome to trac!
The REST API intentionally does not support orderby of rand due to performance issues and it breaks caching guarantees, see #38693.
The REST API is very extensible, so plugins can easily add support for it if they'd like to: https://felipeelia.dev/wordpress-rest-api-enable-random-order-of-posts-list/
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/58412#ticket