Automattic\WooCommerce\Admin\API\Reports\Categories
DataStore::normalize_order_by
Maps ordering specified by the user to columns in the database/fields in the data.
Метод класса: DataStore{}
Хуков нет.
Возвращает
Строку.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->normalize_order_by( $order_by );
- $order_by(строка) (обязательный)
- Sorting criterion.
Код DataStore::normalize_order_by() DataStore::normalize order by WC 11.0.1
protected function normalize_order_by( $order_by ) {
if ( 'date' === $order_by ) {
return 'time_interval';
}
if ( 'category' === $order_by ) {
return '_terms.name';
}
return $order_by;
}