[wp-trac] [WordPress Trac] #35692: Allow seed value to be passed to WP_Query when using random ordering
WordPress Trac
noreply at wordpress.org
Fri Feb 12 19:39:02 UTC 2016
#35692: Allow seed value to be passed to WP_Query when using random ordering
-------------------------------------------------+-------------------------
Reporter: hlashbrooke | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: Query | Review
Severity: normal | Version: trunk
Keywords: has-patch needs-unit-tests 2nd- | Resolution:
opinion | Focuses:
-------------------------------------------------+-------------------------
Changes (by boonebgorges):
* keywords: has-patch needs-unit-tests => has-patch needs-unit-tests 2nd-
opinion
Comment:
There's something about this syntax that feels wrong to me. `$seed` is not
a very transparent parameter name. And passing around a `$seed` parameter
when invoking `parse_orderby()` seems somehow too ad hoc.
Here's an idea: allow `orderby` to accept `RAND(3)` in addition to `RAND`.
We would need some validation to make sure it's a integer. But it keeps
the syntax much simpler and, IMO, intuitive for devs.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35692#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list