bp_esc_sql_order( string $order = '' )
Sanitize an ‘order’ parameter for use in building SQL queries.
Description Description
Strings like ‘DESC’, ‘desc’, ‘ desc’ will be interpreted into ‘DESC’. Everything else becomes ‘ASC’.
Parameters Parameters
- $order
-
(Optional) The 'order' string, as passed to the SQL constructor.
Default value: ''
Return Return
(string) The sanitized value 'DESC' or 'ASC'.
Source Source
File: bp-core/bp-core-functions.php
function bp_esc_sql_order( $order = '' ) { $order = strtoupper( trim( $order ) ); return 'DESC' === $order ? 'DESC' : 'ASC'; }
Changelog Changelog
Version | Description |
---|---|
1.8.0 | Introduced. |