sanitize_sql_orderby
sanitize_sql_orderby ( $orderby )
Parameters:- (string) orderby Order by clause to be validated.
Returns:- (string|false) Returns $orderby if valid, false otherwise.
Defined at: - Introduced in WordPress: 2.5.1
- Deprecated in WordPress: —
Description
Ensures a string is a valid SQL 'order by' clause.Accepts one or more columns, with or without a sort order (ASC / DESC).
e.g. 'column_1', 'column_1, column_2', 'column_1 ASC, column_2 DESC' etc.
Also accepts 'RAND()'.