[wp-trac] [WordPress Trac] #29902: Allow no ORDER BY for comments in WP_Comment_Query
WordPress Trac
noreply at wordpress.org
Fri Oct 24 02:38:45 UTC 2014
#29902: Allow no ORDER BY for comments in WP_Comment_Query
-------------------------+--------------------------
Reporter: psycleuk | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.1
Component: Comments | Version: 4.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses: performance
-------------------------+--------------------------
Changes (by boonebgorges):
* milestone: Awaiting Review => 4.1
Comment:
psycleuk - Thanks very much for the ticket and the patch.
We can't go with exactly your suggestion - the logic
https://core.trac.wordpress.org/browser/tags/4.0/src/wp-
includes/comment.php#L318 currently makes it so that `$orderby` can never
be empty, so your `if ( $orderby )` condition will always be hit. We'll do
what `WP_Query` does: skip the ORDER BY with boolean false or the word
'none'.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29902#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list