Automattic\WooCommerce\Internal\Admin\Settings
PaymentsRestController::sanitize_providers_order_arg
Sanitize the providers ordering argument.
Method of the class: PaymentsRestController{}
No Hooks.
Returns
Array.
Usage
// private - for code of main (parent) class only $result = $this->sanitize_providers_order_arg( $value ): array;
- $value(array) (required)
- Value of the argument.
PaymentsRestController::sanitize_providers_order_arg() PaymentsRestController::sanitize providers order arg code WC 10.5.0
private function sanitize_providers_order_arg( array $value ): array {
// Sanitize the ordering object to ensure that the order values are integers and the provider IDs are safe strings.
foreach ( $value as $provider_id => $order ) {
$id = $this->sanitize_provider_id( $provider_id );
$value[ $id ] = intval( $order );
}
return $value;
}