#58412 closed enhancement (wontfix)
Allowing rand orderby value for post query params
Reported by: | vrishabhsk | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7 |
Component: | REST API | Keywords: | dev-feedback has-patch |
Focuses: | performance | Cc: |
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.
17 months ago
#1
- Keywords has-patch added
#2
@
17 months ago
- Focuses performance added; rest-api removed
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
- Version changed from trunk to 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/
Note: See
TracTickets for help on using
tickets.
Trac ticket: https://core.trac.wordpress.org/ticket/58412#ticket