LLMS_Database_Query::sql_orderby()
Retrieve the prepared SQL for the ORDER BY clause.
Return Return
(string)
Source Source
File: includes/abstracts/abstract.llms.database.query.php
protected function sql_orderby() {
$sql = '';
$sort = $this->get( 'sort' );
if ( $sort ) {
$sql = 'ORDER BY';
$comma = false;
foreach ( $sort as $orderby => $order ) {
$pre = ( $comma ) ? ', ' : ' ';
$sql .= $pre . "{$orderby} {$order}";
$comma = true;
}
}
if ( $this->get( 'suppress_filters' ) ) {
return $sql;
}
/**
* Filters the query ORDER BY clause.
*
* The dynamic part of the filter `$this->id` identifies the extending query.
*
* @since 3.8.0
*
* @param string $sql The ORDER BY clause of the query.
* @param LLMS_Database_Query $db_query The LLMS_Database_Query instance.
*/
return apply_filters( "llms_{$this->id}_query_orderby", $sql, $this );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.5.1 | Drop use of $this->get_filter('orderby') in favor of "llms_{$this->id}_query_orderby". |
| 3.8.0 | |
| 3.34.0 | Introduced. |