wp-graphql-gravity-forms icon indicating copy to clipboard operation
wp-graphql-gravity-forms copied to clipboard

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

Open Gytjarek opened this issue 7 months ago • 1 comments

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

Gytjarek avatar Jul 31 '24 12:07 Gytjarek