Automattic\WooCommerce\Admin\API\Reports
GenericController::apply_custom_orderby_filters
Apply a filter for custom orderby enum.
Метод класса: GenericController{}
Хуки из метода
Возвращает
Массив. An array of filtered orderby enum options.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->apply_custom_orderby_filters( $orderby_enum );
- $orderby_enum(массив) (обязательный)
- An array of orderby enum options.
Список изменений
| С версии 9.4.0 | Введена. |
Код GenericController::apply_custom_orderby_filters() GenericController::apply custom orderby filters WC 10.7.0
protected function apply_custom_orderby_filters( $orderby_enum ) {
/**
* Filter orderby query parameter enum.
*
* There was an initial concern about potential SQL injection with the custom orderby.
* However, testing shows it is safely blocked by validation in the controller,
* which results in an "Invalid parameter(s): orderby" error.
*
* Additionally, it's the responsibility of the merchant/developer to ensure the custom orderby is valid,
* or a WordPress database error will occur for unknown columns.
*
* @since 9.4.0
*
* @param array $orderby_enum The orderby query parameter enum.
*/
return apply_filters( "woocommerce_analytics_orderby_enum_{$this->rest_base}", $orderby_enum );
}