Skip to:
Content

BuddyPress.org

Changeset 8669


Ignore:
Timestamp:
07/22/2014 11:10:47 PM (10 years ago)
Author:
imath
Message:

Add two new filters to allow group order to be customized in Groups directory

The first filter bp_groups_get_orderby will help to customize the order and orderby attributes of BP_Groups_Group::get() method.
The second one bp_groups_get_orderby_converted_by_term will help to edit the corresponding SQL term/column.

Fixes #3161

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-classes.php

    r8605 r8669  
    739739        // 'order' and 'orderby' params passed to the function
    740740        if (  ! empty( $r['type'] ) ) {
    741             $order_orderby = self::convert_type_to_order_orderby( $r['type'] );
     741            $order_orderby = apply_filters( 'bp_groups_get_orderby', self::convert_type_to_order_orderby( $r['type'] ), $r['type'] );
    742742
    743743            // If an invalid type is passed, $order_orderby will be
     
    757757
    758758        // Convert 'orderby' into the proper ORDER BY term
    759         $orderby = self::convert_orderby_to_order_by_term( $orderby );
     759        $orderby = apply_filters( 'bp_groups_get_orderby_converted_by_term', self::convert_orderby_to_order_by_term( $orderby ), $orderby, $r['type'] );
    760760
    761761        // Random order is a special case
Note: See TracChangeset for help on using the changeset viewer.