type(); } /** * Checks the address. * * @param Field $field Field being validated. * @param mixed $value Sanitised value. * * @return ValidationError|null The failure, or null when the value passes. */ public function validate( Field $field, mixed $value ): ?ValidationError { if ( is_email( (string) $value ) ) { return null; } return new ValidationError( '', 'invalid_email', __( 'Please enter a valid email address.', 'devplugins-custom-form-builder' ) ); } }