Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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 @TimothyBlynJacobs
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/

#3 @galbaras
3 years ago

I think this decision may be overstepping. Let site owners decide what's good for their sites' performance. If it sucks, they'll use something else, but if it's important, it should be there.

Note: See TracTickets for help on using tickets.