Automattic\WooCommerce\Internal\Admin\Settings
PaymentsRestController::sanitize_providers_order_arg()
Sanitize the providers ordering argument.
Method of the class: PaymentsRestController{}
No Hooks.
Return
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 9.7.1
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 = sanitize_key( $provider_id ); $value[ $id ] = intval( $order ); } return $value; }