// Gravity Form Validation for Phone OR Email address
add_filter( 'gform_validation_1', 'validate_phone_or_email', 10, 2 );
function validate_phone_or_email( $validation_result ) {
$form = $validation_result['form'];
if ( empty( rgpost( 'input_2' ) ) && empty( rgpost( 'input_3' ) ) ) {
$validation_result['is_valid'] = false;
foreach ( $form['fields'] as &$field ) {
if ( $field->type == 'phone' || $field->type == 'email' ) {
$field->failed_validation = true;
$field->validation_message = 'You must enter a valid phone number <strong>or</strong> email address.';
}
}
}
return $validation_result;
}
You can read more on the documentation for this filter here: https://docs.gravityforms.com/gform_validation/