Skip to:
Content

BuddyPress.org

Ticket #3161: 3161.patch

File 3161.patch, 1.1 KB (added by imath, 10 years ago)
  • src/bp-groups/bp-groups-classes.php

    diff --git src/bp-groups/bp-groups-classes.php src/bp-groups/bp-groups-classes.php
    index 051b861..76e3f6d 100644
    class BP_Groups_Group { 
    738738                // If a 'type' parameter was passed, parse it and overwrite
    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
    744744                        // an array with empty values. In this case, we stick
    class BP_Groups_Group { 
    756756                $order = bp_esc_sql_order( $order );
    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
    762762                if ( 'rand()' === $orderby ) {