Below is a list of action hooks that are available in the Simple Membership plugin.
Table of Contents
- Front-End Hooks
- swpm_after_login
- swpm_before_login_request_is_processed
- swpm_logout
- swpm_front_end_registration_complete
- swpm_front_end_registration_complete_user_data
- swpm_front_end_registration_complete_fb
- swpm_front_end_registration_form_submitted
- swpm_fb_front_end_registration_form_submitted
- swpm_front_end_edit_profile_form_submitted
- swpm_fb_front_end_edit_profile_form_submitted
- swpm_front_end_profile_edited
- swpm_front_end_profile_edited_fb
- Admin Side Hooks
- Payment Processing
- Cronjob Related
- Miscellaneous Shortcodes Addon Related
Front-End Hooks
swpm_after_login
This hook executes after a member logs into your site
swpm_before_login_request_is_processed
This hook is triggered before the login request is processed by the plugin. It can be used to add extra custom checks/validation from your custom code.
swpm_logout
This hook executes when a member logs out of your site.
swpm_front_end_registration_complete
This hook executes after a member completes the registration
swpm_front_end_registration_complete_user_data
This hook executes after a member completes the registration. This hook passes the member’s info also.
Below is an example of how to use this hook:
add_action('swpm_front_end_registration_complete_user_data', 'after_registration_callback');
function after_registration_callback ($member_info)
{
//Do stuff
//print_r($member_info);//Lets see what info is in this array.
}
swpm_front_end_registration_complete_fb
This hook executes after a member completes the registration using the From Builder addon. This hook passes the member’s info also.
swpm_front_end_registration_form_submitted
This action hook is triggered after the standard registration form is submitted. It can be used to perform custom validation or additional checks before the form is processed by the plugin.
swpm_fb_front_end_registration_form_submitted
This action hook is triggered after the registration form is submitted when using the Form Builder addon. It serves the same purpose as the standard hook and can be used to run custom validation or logic before the form is processed.
swpm_front_end_edit_profile_form_submitted
This action hook is triggered after the standard profile edit form is submitted. It can be used to perform custom validation or additional checks before the form is processed by the plugin.
swpm_fb_front_end_edit_profile_form_submitted
This action hook is triggered after the profile edit form is submitted when using the Form Builder addon. It serves the same purpose as the standard hook and can be used to run custom validation or logic before the form is processed.
swpm_front_end_profile_edited
This hook is triggered after a member updates their profile from the Edit Profile page, and the plugin has finished processing the changes.
Below is an example of how to use this hook:
add_action('swpm_front_end_profile_edited', 'after_profile_edit_callback');
function after_profile_edit_callback($member_info)
{
//Do stuff
//print_r($member_info);//Lets see what info is in this array.
}
swpm_front_end_profile_edited_fb
This hook executes after a member edits the profile from the edit profile page and is using the From Builder addon. This hook passes the member’s info also.
Admin Side Hooks
swpm_after_main_admin_menu
This hook executes after the plugin’s admin menu code is run.
Payment Processing
swpm_payment_ipn_processed
This hook executes after a payment from any payment gateway (PayPal, Stripe etc.) is processed. The hook will pass the payment data using an array parameter.
swpm_paypal_ipn_processed
This hook executes after the PayPal IPN has been processed. The hook will pass the payment data using an array parameter.
swpm_stripe_ipn_processed
This hook executes after the Stripe payment has been processed. The hook will pass the payment data using an array parameter.
swpm_braintree_ipn_processed
This hook executes after the Braintree payment has been processed. The hook will pass the payment data using an array parameter.
Cronjob Related
swpm_cronjob_account_status_updated_to_expired
This action hook is triggered during the daily cronjob’s evaluation of the member’s account expiry condition and subsequent update of the account status to “expired.” The hook passes an array argument that includes the member ID values of the expired accounts.
Miscellaneous Shortcodes Addon Related
Refer to the Hooks section of the Miscellaneous Shortcodes Addon documentation to learn more about the available action and filter hooks.