- 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_import_givewp_phase_mappers Filter Hook
Overview
The suredonation_import_givewp_phase_mappers filter allows developers to register or modify the mapper classes used during a GiveWP migration.
Each migration phase is assigned to a mapper class. The mapper is responsible for processing the records associated with that phase.
Use this filter when you add a custom migration phase with suredonation_import_givewp_phases and need to define how that phase should be processed.
When to Use This Filter
Use this filter to:
- Register a mapper for a custom GiveWP migration phase.
- Extend the existing phase-to-mapper configuration.
- Replace a built-in mapper when custom processing is required.
- Connect a migration phase with your custom mapper class.
Filter Signature
apply_filters( 'suredonation_import_givewp_phase_mappers', $mappers );Parameters
| Parameter | Type | Description |
| $mappers | array | Map of GiveWP migration phase names to fully qualified mapper class names. |
Default Mappers
SureDonation provides the following default mappings:
[
    'campaigns' => Campaign_Mapper::class,
    'donations' => Donation_Mapper::class,
]Return Value
Return the phase-to-mapper class map.
return $mappers;
Each registered mapper class must provide:
- A public process_batch( &$progress, $offset ) method.
- A static get_instance() method.
The process_batch() method should return the number of source records processed.
Basic Usage
add_filter( 'suredonation_import_givewp_phase_mappers', 'your_custom_function',  10, 1);
function your_custom_function( $mappers ) {
    // Add or modify mapper registrations here.
    return $mappers;
}Example: Register a Custom Mapper
The following example registers a mapper for a custom migration phase.
add_filter( 'suredonation_import_givewp_phase_mappers', 'mysite_register_mapper', 10, 1);
function mysite_register_mapper( $mappers ) {
    $mappers['my_custom_phase'] = \MyPlugin\Import\My_Custom_Mapper::class;
    return $mappers;
}The resulting map contains:
[
    'campaigns'    => Campaign_Mapper::class,
    'donations'    => Donation_Mapper::class,
    'my_custom_phase' => \MyPlugin\Import\My_Custom_Mapper::class,
]Creating a Custom Mapper
Your custom mapper must provide the methods expected by the GiveWP migration runner.
A simplified structure looks like this: namespace MyPlugin\Import;
class My_Custom_Mapper {
    public static function get_instance() {
        // Return the mapper instance.
    }
    public function process_batch( &$progress, $offset ) {
        // Process records for this phase.
        return $processed;
    }
}The process_batch() method should return the number of source records processed during the batch.
Migration Flow
The mapper filter is part of the GiveWP migration process:
- SureDonation determines the phases that need to run.
- The migration runner requests the mapper for the current phase.
- The suredonation_import_givewp_phase_mappers filter is applied.
- SureDonation looks for the mapper class associated with the phase.
- The mapper’s get_instance() method is used to resolve the mapper.
- The migration runner calls process_batch().
- The mapper processes the records for that phase.
- The migration continues with the next phase.
Important: Register the Phase Separately
Registering a mapper does not automatically add the phase to the migration.
For example, registering:
$mappers['my_custom_phase'] = \MyPlugin\Import\My_Custom_Mapper::class;does not cause my_custom_phase to run automatically.
The phase must also be added using:
suredonation_import_givewp_phases
For example:
add_filter(
    'suredonation_import_givewp_phases',
    function ( $phases ) {
        $phases[] = 'my_custom_phase';
        return $phases;
    }
);Handling Invalid Mappers
If the requested phase:
- Does not exist in the mapper map.
- Points to a class that does not exist.
- Points to a class without a callable get_instance() method.
the mapper resolves to null, and the migration phase is skipped.
Make sure your custom mapper class is loaded and provides the required methods before registering it.
Related Hooks
- suredonation_import_givewp_phases: Controls which phases are included in a GiveWP migration.
- suredonation_import_givewp_batch_complete: Runs when a GiveWP migration batch is completed.
We don't respond to the article feedback, we use it to improve our support content.