- Handle Custom Stripe Webhook Events
- suredonation_export_secret_option_keys Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- Validate Field Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_secret_option_keys Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- suredonation_enqueue_form_frontend_scripts Action Hook
- suredonation_after_form_duplicated Action Hook
- suredonation_email_sent Action Hook
- suredonation_donor_user_created Action Hook
- suredonation_donation_refunded Action Hook
- suredonation_donation_status_changed Action Hook
- suredonation_donation_completed Action Hook
- suredonation_new_donation Action Hook
- suredonation_donation_created Action Hook
suredonation_phone_geo_enabled Filter Hook
Overview
The suredonation_phone_geo_enabled filter controls whether SureDonation uses an IP geolocation service to automatically detect a visitor’s country for the Phone field.
This filter acts as a global switch. Returning false disables IP-based country detection for all SureDonation Phone fields.
This can be useful when you want to avoid third-party IP geolocation requests for privacy, GDPR, or other compliance requirements.
When to Use This Filter
Use this filter when you need to control automatic IP-based country detection.
For example, you can use it to:
- Disable third-party IP geolocation.
- Improve privacy.
- Support GDPR or other privacy requirements.
- Prevent external geolocation requests.
- Ensure all Phone fields use the default country.
Filter Signature
apply_filters( 'suredonation_phone_geo_enabled', true );Parameters
| Parameter | Type | Description |
| $enabled | bool | Determines whether automatic IP-based country detection is enabled. |
Default Value
The default value is: true
This means IP-based country detection is enabled by default.
Return Value
Return a boolean value:
| Return Value | Result |
| true | Allows IP-based country detection to run. |
| false | Disables IP-based country detection. The Phone field defaults to us. |
Basic Usage
Use add_filter() to register your callback.
add_filter( 'suredonation_phone_geo_enabled', 'your_custom_function', 10, 1);
function your_custom_function( $enabled ) {
    return $enabled;
}Example: Disable IP-Based Country Detection
The following example disables automatic country detection for all SureDonation Phone fields.
// Disable IP-based country detection entirely.
add_filter( 'suredonation_phone_geo_enabled', Â '__return_false');When disabled, SureDonation skips the IP geolocation lookup and uses us as the default country.
Example: Conditionally Disable Detection
You can also use custom logic to determine whether IP-based country detection should be enabled.
add_filter( 'suredonation_phone_geo_enabled', 'mysite_disable_phone_geo', 10, 1);
function mysite_disable_phone_geo( $enabled ) {
    if ( defined( 'MY_PRIVACY_MODE' ) && MY_PRIVACY_MODE ) {
        return false;
    }
    return $enabled;
}How It Works
When a SureDonation Phone field needs to determine the visitor’s country:
- SureDonation checks the suredonation_phone_geo_enabled filter.
- If the filter returns false, the geolocation lookup is skipped.
- The Phone field uses us as the default country.
- If the filter returns true, SureDonation continues with IP-based country detection.
- The country detected by the geolocation service can then be used by the Phone field.
Additional Conditions
Returning true does not guarantee that a geolocation request will be made.
SureDonation also skips IP-based country detection in certain contexts, including:
- Admin requests.
- REST API requests.
- Requests with an empty IP address.
- Private IP addresses.
- Reserved IP addresses.
Privacy Considerations
This filter can be useful when your site’s privacy requirements do not allow visitor IP addresses to be sent to a third-party geolocation service.
Disabling the filter prevents the IP-based country detection request for all Phone fields.
Related Hooks
- suredonation_phone_geo_api_hourly_cap: Controls the hourly limit for IP geolocation API requests.
We don't respond to the article feedback, we use it to improve our support content.