Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpapf-save-national-format.php: Added new snippet. #1034

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matty0501
Copy link
Contributor

@matty0501 matty0501 commented Feb 28, 2025

Context

⛑️ Ticket(s): https://secure.helpscout.net/conversation/2768711698/74235?folderId=14964

Summary

The snippet saves the phone number in the entry as the National format, rather than the default International.

Copy link
Contributor

@saifsultanc saifsultanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good. Would add a safety check here. Context and explanation added: https://www.loom.com/share/35365cfe2c5e402db0dfeac88632288c

Let me know if you want to discuss anything!


$proto = gp_advanced_phone_field()->get_phone_number_proto( $value );
$phone_number_util = \libphonenumber\PhoneNumberUtil::getInstance();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a condition here to check on $proto object before processing

Suggested change
if ( ! $proto ) {
return $value;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants