Automattic\WooCommerce\EmailEditor\Validator
Validator::validate
Strict validation & sanitization implementation. It only coerces int to float (e.g. 5 to 5.0).
Method of the class: Validator{}
No Hooks.
Returns
Mixed.
Usage
$Validator = new Validator(); $Validator->validate( $schema, $value, $param_name );
- $schema(Schema) (required)
- The schema to validate against.
- $value(mixed) (required)
- The value to validate.
- $param_name(string)
- The parameter name.
Default:'value'
Validator::validate() Validator::validate code WC 10.5.0
public function validate( Schema $schema, $value, string $param_name = 'value' ) {
return $this->validate_schema_array( $schema->to_array(), $value, $param_name );
}