Open Gytjarek opened 4 months ago
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.
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:
So we know its properties, which would help in implementing it. In the same way, we could support more custom formats added with the
gform_phone_formats
filterWhat 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