alpha1
8/23/2016 - 7:54 AM

Gravity Forms: Simple field check to see if the field is an email

Gravity Forms: Simple field check to see if the field is an email

<?php
add_filter( 'gform_field_validation_3_1', 'email_valdity_check', 10, 4 );
function email_valdity_check( $result, $value, $form, $field ){
	if( is_email( $value ) ){
		$result['is_valid'] = true;
	} else {
		$result['is_valid'] = false;
		$result['message'] 	= __( 'Email address is not valud', 'text_domain' );
	}
	return $result;
}
?>