Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::default_sanitize_callback │ public │ WC 1.0

Deprecated since 11.2.0 Fields are wired to their field type's sanitize() method instead.. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.

If a field does not declare a sanitization callback, this is the default sanitization callback.

Method of the class: CheckoutFields{}

No Hooks.

Returns

mixed.

Usage

$CheckoutFields = new CheckoutFields();
$CheckoutFields->default_sanitize_callback( $value, $field );
$value(mixed) (required)
Value to sanitize.
$field(array) (required)
Field data.

Changelog

Deprecated since 11.2.0 Fields are wired to their field type's sanitize() method instead.

CheckoutFields::default_sanitize_callback() code WC 11.2.2

public function default_sanitize_callback( $value, $field ) {
	return $this->get_field_type( $field )->sanitize( $value, $field );
}