Automattic\WooCommerce\Blocks\Domain\Services
CheckoutFields::default_validate_callback
Deprecated since 11.2.0 Fields are wired to their field type's default_validate() 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 validation callback, this is the default validation callback.
Method of the class: CheckoutFields{}
No Hooks.
Returns
WP_Error|void. If there is a validation error, return an WP_Error object.
Usage
$CheckoutFields = new CheckoutFields(); $CheckoutFields->default_validate_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 default_validate() method instead. |
CheckoutFields::default_validate_callback() CheckoutFields::default validate callback code WC 11.2.2
public function default_validate_callback( $value, $field ) {
return $this->get_field_type( $field )->default_validate( $value, $field );
}