Description
Implement 'bw_field_validation_email' filter for oik-fieldsValidate to be in email format.
Usage
$$string = oik_fields_validation_email( $value, $field, $data );Parameters
- $value
- ( string ) required – the value of the field from the $validated array (it may be null)
- $field
- ( string ) required – the field name
- $data
- ( array ) required – the field's registration data
Returns
$string The validated / sanitized valueSource
File name: oik-fields/includes/oik-fields-validation.phpLines:
1 to 13 of 13
function oik_fields_validation_email( $value, $field, $data ) { if ( $value ) { $email = is_email( $value ); if ( false === $email ) { bw_issue_message( $field, "bw_invalid_email", __( "Invalid email address" ), "error" ); } else { bw_trace2( "!$email!", "email?" ); } } else { $email = null; } return( $email ); }View on GitHub
