-
Notifications
You must be signed in to change notification settings - Fork 92
gpapf-show-all-countries.php
: Added new snippet.
#1167
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
Conversation
WalkthroughAdds a new PHP snippet that registers a form/field-specific Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant WP as WordPress
participant GP as Gravity Perks APF
participant Snippet as gpapf-show-all-countries.php
User->>WP: Load page with form
WP->>GP: Initialize APF for form/field (IDs 123/4)
GP->>Snippet: apply filter gpapf_init_args_123_4($args)
Note right of Snippet: set args.countriesAction = "all"
Snippet-->>GP: return modified $args
GP-->>WP: initialize phone field with updated args
WP-->>User: render phone field with all countries in picker
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
gp-advanced-phone-field/gpapf-show-all-countries.php (2)
6-7
: Tighten docblock phrasingMinor grammar/clarity improvement.
- * This snippet will show all countries in the flag picker for a specific form/field. It is useful if you have limited to specific countries - * on the plugin settings, but want to allow all countries on a specific form/field. + * This snippet shows all countries in the flag picker for a specific form/field. Useful when the plugin settings restrict countries globally, + * but a specific form/field should allow all countries.
13-13
: Optionally declare accepted args for self‑documentationNot required (defaults are fine), but explicit args can improve readability.
-} ); +}, 10, 1 );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
gp-advanced-phone-field/gpapf-show-all-countries.php
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: PHPCS (Files Changed)
gp-advanced-phone-field/gpapf-show-all-countries.php
[failure] 12-12:
Line indented incorrectly; expected at least 1 tabs, found 2 spaces
[failure] 12-12:
Multi-line function call not indented correctly; expected 4 spaces but found 2
[warning] 12-12:
Found precision alignment of 2 spaces.
[failure] 11-11:
Line indented incorrectly; expected at least 1 tabs, found 2 spaces
[failure] 11-11:
Multi-line function call not indented correctly; expected 4 spaces but found 2
[warning] 11-11:
Found precision alignment of 2 spaces.
🪛 GitHub Actions: PHP Lint (PR)
gp-advanced-phone-field/gpapf-show-all-countries.php
[warning] 11-11: PHPCS (thenabeel/action-phpcs@v8): WordPress.WhiteSpace.PrecisionAlignment.Found - Found precision alignment of 2 spaces.
[error] 11-11: PHPCS (thenabeel/action-phpcs@v8): PEAR.Functions.FunctionCallSignature.Indent - Multi-line function call not indented correctly; expected 4 spaces but found 2.
🔇 Additional comments (1)
gp-advanced-phone-field/gpapf-show-all-countries.php (1)
1-5
: LGTM — filter signature verified.
Use gpapf_init_args_{FORMID}_{FIELDID} (e.g., gpapf_init_args_123_4).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/3078299767/89409?viewId=7627047
Summary
This snippet will set the allowed countries in GPAPF to
All
for a specific form/field. Useful for if a user has locked down the countries in the plugin settings, but wants to allow all countries for a specific form.