Skip to content

[Phone field] - extend the phoneFormat field or create a new one to return format properties along with the selected format #441

Open

Description

@Gytjarek

What problem does this address?

Phone field currently returns two formats: international and standard. By having this value, you don't get much except its name. It would be nice to expand that field or create another one to get the currently selected phone format with their values:

'standard' => array(
'label' => '(###) ###-####',
'mask' => '(999) 999-9999',
'regex' => '/^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$/',
'instruction' => '(###) ###-####',
'type' => 'standard',
),

So we know its properties, which would help in implementing it. In the same way, we could support more custom formats added with thegform_phone_formats filter

What is your proposed solution?

Create a new field for the Phone field which will be returning other props, like label, mask, regex and instruction along with selected type. Make sure, custom formats will be supported as well

What alternatives have you considered?

No response

Additional Context

No response

Activity

  1. justlevine commented on Aug 2, 2024

    @justlevine
    Member

    Thanks for suggesting this @Gytjarek !

    Normally, I'm not a fan of mixing implementation details with implementation definitions, but in this case, since gform_phone_formats exposes the entire object, we want to be able to provide the site-specific context.

    Feel free to submit a PR if you want this in sooner than I can get around to it.

  2. added this to the v0.13.4 milestone on Feb 14, 2026
  3. justlevine commented on Feb 14, 2026

    @justlevine
    Member

    This was added in #475 via the PhoneFormat._phoneFormatExperimental: GfPhoneFormat field. In the next breaking release, the phoneFormat field will be updated to use the new type.

    Leaving this PR open until then.

  4. modified the milestones: v0.13.4, v0.14 on Feb 14, 2026
  5. justlevine commented on Jul 11, 2026

    @justlevine
    Member

    🤖 Automated Triage

    Classification: type: enhancement ⚡ · priority: medium · breaking change 💥
    Agent-feasible: Yes — bounded scope (extend Phone field type with format properties), though already marked in progress.
    Estimated effort: Agent medium · Human medium

    Summary: Request to expose phone format properties (label, mask, regex, instruction) via a new GraphQL field, including support for custom formats registered through the gform_phone_formats filter. The breaking change label suggests the new field may alter the existing phoneFormat return shape. Already in progress — agent should verify whether active work exists before intervening.

    Next steps: Already in progress. If the active PR has stalled, agent can pick up implementation. Ensure custom formats from gform_phone_formats are included in the resolver, not just the two built-in formats.

  6. added
    priority: mediumminor perf improvements, fix broad userbase issues
    triagedIssue has been analyzed by the triage pipeline
    on Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions