BP_Invitation::get_order_by_sql( array $args = array() )
Assemble the ORDER BY clause of a get() SQL statement.
Description
Used by BP_Invitation::get() to create its ORDER BY clause.
Parameters
- $args
-
(Optional) See BP_Invitation::get() for more details.
Default value: array()
Return
(string) ORDER BY clause.
Source
File: bp-core/classes/class-bp-invitation.php
protected static function get_order_by_sql( $args = array() ) { // Setup local variable $conditions = array(); $retval = ''; // Order by if ( ! empty( $args['order_by'] ) ) { $order_by = implode( ', ', (array) $args['order_by'] ); $conditions['order_by'] = "{$order_by}"; } // Sort order direction if ( ! empty( $args['sort_order'] ) ) { $sort_order = bp_esc_sql_order( $args['sort_order'] ); $conditions['sort_order'] = "{$sort_order}"; } // Custom ORDER BY if ( ! empty( $conditions ) ) { $retval = 'ORDER BY ' . implode( ' ', $conditions ); } return $retval; }
Changelog
Version | Description |
---|---|
BuddyBoss 1.3.5 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.