[buddypress-trac] [BuddyPress Trac] #7205: Adds 'orderby' support to Activity queries

buddypress-trac noreply at wordpress.org
Mon Jun 5 20:10:42 UTC 2017


#7205: Adds 'orderby' support to Activity queries
-------------------------+------------------
 Reporter:  Mamaduka     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.9
Component:  Activity     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by r-a-y):

 Patch looks good, @tw2113!

 Instead of the `array_key_exists()` check, maybe switch() would be better?
 {{{#!php
 <?php

 switch ( $r['order_by'] ) {
     case 'id' :
     case 'user_id' :
     case 'component' :
     case 'all the other DB columns!':
         break;

     default :
         $r['order_by'] = 'date_recorded';
         break;
 }
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7205#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list