Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFieldsSchema
Validation::has_field_schema
Check if the fields have defined schema.
Method of the class: Validation{}
No Hooks.
Returns
true|false.
Usage
$result = Validation::has_field_schema( $fields );
- $fields(array) (required)
- The fields.
Validation::has_field_schema() Validation::has field schema code WC 10.7.0
public static function has_field_schema( $fields ) {
$return = false;
foreach ( $fields as $field ) {
if (
( ! empty( $field['validation'] ) && is_array( $field['validation'] ) ) ||
( ! empty( $field['required'] ) && is_array( $field['required'] ) ) ||
( ! empty( $field['hidden'] ) && is_array( $field['hidden'] ) )
) {
$return = true;
break;
}
}
return $return;
}