Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableQuery::sanitize_order()
Makes sure the order in an ORDER BY statement is either 'ASC' o 'DESC'.
Method of the class: OrdersTableQuery{}
No Hooks.
Return
String
. The sanitized order.
Usage
// private - for code of main (parent) class only $result = $this->sanitize_order( $order ): string;
- $order(string) (required)
- The unsanitized order.
OrdersTableQuery::sanitize_order() OrdersTableQuery::sanitize order code WC 9.3.3
private function sanitize_order( string $order ): string { $order = strtoupper( $order ); return in_array( $order, array( 'ASC', 'DESC' ), true ) ? $order : 'DESC'; }