Disable Phone Validation

Disable phone number validation provided by Advanced Phone Field.

Instructions

Code

Filename: gpapf-disable-validation.php

<?php
/**
 * Gravity Perks // Advanced Phone Field // Disable Phone Validation
 * https://gravitywiz.com/documentation/gravity-forms-advanced-phone-field/
 *
 * Instruction Video: https://www.loom.com/share/ab1b6a0f4f7b4751b253bface18bfa3e
 *
 * Plugin Name:  GP Advanced Phone Field — Disable Phone Validation
 * Description:  Disable phone number validation provided by Advanced Phone Field.
 * Author:       Gravity Wiz
 * Version:      0.1
 * Author URI:   https://gravitywiz.com
 */
add_action( 'init', function () {
	if ( ! function_exists( 'gp_advanced_phone_field' ) ) {
		return;
	}

	remove_filter( 'gform_field_validation', array( gp_advanced_phone_field(), 'validation' ) );
}, 16 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.