[wp-trac] [WordPress Trac] #21875: get_categories orderby random

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 12 23:38:57 UTC 2012


#21875: get_categories orderby random
-------------------------+----------------------
 Reporter:  Ninos Ego    |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Taxonomy     |     Version:  3.4.2
 Severity:  trivial      |  Resolution:  wontfix
 Keywords:               |
-------------------------+----------------------

Comment (by nacin):

 Replying to [comment:2 Ninos Ego]:
 > Have used the shuffle function, but think, that my way brings a better
 performance..

 When you push randomization to SQL, it means we can't actually cache the
 results, as they're supposed to be random. get_posts() does pagination,
 which is why we push it to SQL — you need only X of Y posts, but a random
 X of them.

 But get_terms(), as scribu said, isn't paginated. Thus, letting the query
 be cached, then shuffling them on your own, makes more sense.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21875#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list