Skip to main content

GravityKit\GravityMigrate\Schema\GfPhoneFormat

The two telephone formats Gravity Forms has, and how to choose between them.

GF_Field_Phone offers exactly two: 'standard', which is US Standard validated against a US-only regex, and 'international', which is unformatted and unvalidated (class-gf-field-phone.php:866-876). Every other platform's telephone setting has to land on one of those two.

A platform pattern that neither format expresses becomes 'international' and is reported. Narrowing it to 'standard' instead would start rejecting numbers people submit today.

Since: %ver%

Source: src/Schema/GfPhoneFormat.php:23

Details

  • Kind: class
  • Namespace: GravityKit\GravityMigrate\Schema

Methods

MethodDescription
is_us_pattern()Whether a platform's stored pattern describes the same thing Gravity Forms calls standard.

Method Reference

is_us_pattern()

public static function is_us_pattern( string $pattern ): bool

Whether a platform's stored pattern describes the same thing Gravity Forms calls standard.

Parameters

NameTypeDefaultDescription
$patternstringThe platform's stored pattern.

Returns

  • bool

Since: %ver%

Source: src/Schema/GfPhoneFormat.php:64