Changeset 7088
- Timestamp:
- 05/19/2013 12:26:47 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-admin.php
r7006 r7088 983 983 $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$screen->id}_per_page" ) ); 984 984 985 // Sort order. Note: not supported in bp_has_groups()986 $order = ' ASC';985 // Sort order. 986 $order = 'DESC'; 987 987 if ( !empty( $_REQUEST['order'] ) ) { 988 988 $order = ( 'desc' == strtolower( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC'; … … 990 990 991 991 // Order by - default to newest 992 $ type = 'newest';993 if ( ! empty( $_REQUEST['orderby'] ) ) {992 $orderby = 'last_activity'; 993 if ( ! empty( $_REQUEST['orderby'] ) ) { 994 994 switch ( $_REQUEST['orderby'] ) { 995 995 case 'name' : 996 $ type = 'alphabetical';996 $orderby = 'name'; 997 997 break; 998 998 case 'id' : 999 $ type = 'newest';999 $orderby = 'date_created'; 1000 1000 break; 1001 1001 case 'members' : 1002 $type = 'popular'; 1002 $orderby = 'total_member_count'; 1003 break; 1004 case 'last_active' : 1005 $orderby = 'last_activity'; 1003 1006 break; 1004 1007 } … … 1041 1044 'per_page' => $per_page, 1042 1045 'page' => $page, 1043 ' type' => $type,1046 'orderby' => $orderby, 1044 1047 'order' => $order 1045 1048 ); … … 1193 1196 * Get the column names for sortable columns 1194 1197 * 1198 * Note: It's not documented in WP, but the second item in the 1199 * nested arrays below is $desc_first. Normally, we would set 1200 * last_active to be desc_first (since you're generally interested in 1201 * the *most* recently active group, not the *least*). But because 1202 * the default sort for the Groups admin screen is DESC by last_active, 1203 * we want the first click on the Last Active column header to switch 1204 * the sort order - ie, to make it ASC. Thus last_active is set to 1205 * $desc_first = false. 1206 * 1195 1207 * @return array 1196 1208 * @since BuddyPress (1.7) … … 1198 1210 function get_sortable_columns() { 1199 1211 return array( 1200 'gid' => array( 'gid', 1201 'comment' => array( 'name', 1202 'members' => array( 'members', 1203 'last_active' => array( 'last_active', false ) 1212 'gid' => array( 'gid', false ), 1213 'comment' => array( 'name', false ), 1214 'members' => array( 'members', false ), 1215 'last_active' => array( 'last_active', false ), 1204 1216 ); 1205 1217 }
Note: See TracChangeset
for help on using the changeset viewer.