Below is a list of filter hooks that are available in the Simple Membership plugin.
Table of Contents
- General Purpose Filter Hooks
- Registration Related
- Login and Logout Related
- Password Reset Related
- Edit Profile Form Related
- Email Activation Feature Related
- Thank You Page Related
- Payment Button Related
- Payment Gateway Related
General Purpose Filter Hooks
swpm_members_menu_items_per_page
This filter can be used to override the number of items per page value in the members menu of the plugin.
Below is an example of how to use it:
add_filter('swpm_members_menu_items_per_page', 'my_custom_items_per_page_value');
function my_custom_items_per_page_value($per_page_value) {
$per_page_value = 100; //This will show 100 items per page.
return $per_page_value;
}
swpm_transactions_menu_items_per_page
This filter can be used to override the number of items per page value in the transactions menu of the plugin.
swpm_redirect_to_url
This filter can be used to override a redirection URL.
swpm_get_user_ip_address
This filter can be used to override the logic of how this plugin retrieves a user’s IP address.
swpm_load_template_files
This filter can be used to override the template loading path. Useful if you are doing custom template.
Registration Related
swpm_before_registration_submit_button
This filter is triggered just before the registration form’s submit button is rendered. It can be used to add extra inputs, HTML code or text to the registration form of the plugin.
Below is an example of how to use it:
add_filter('swpm_before_registration_submit_button', 'my_custom_code');
function my_custom_code($output) {
//Add any extra text or HTML code
$output .= 'This text will get shown just above the submit button.';
return $output;
}
swpm_registration_data_before_save
This filter hook is triggered before the user registration data is inserted into the member’s database table. This filter hook allows you to override or modify registration data right before it’s saved.
Below is an example of how to use it:
add_filter('swpm_registration_data_before_save', 'modify_rego_data');
function modify_rego_data($member_data) {
//The $member_data is an array containing the data.
//Modify then return the updated data.
return $member_data;
}
swpm_email_registration_complete_subject
This filter can be used to modify the registration complete email subject dynamically.
swpm_email_registration_complete_body
This filter can be used to modify the registration complete email body dynamically.
swpm_after_registration_redirect_url
This filter can be used to override the core plugin’s after registration redirection URL.
swpm_after_email_activation_redirect_url
This filter hook allows you to override the default redirect URL used by the core plugin after a member activates their account via email.
Login and Logout Related
swpm_get_login_link_url
This hook can be used to override the login URL link’s value that is shown in the protection message.
swpm_before_login_form_submit_button
This filter is triggered just before the login form’s submit button is rendered. It can be used to add extra inputs, HTML code or text to the login form of the plugin.
swpm_after_login_redirect_url
This filter can be used to override the core plugin’s after login redirection URL.
swpm_after_logout_redirect_url
This filter can be used to override the core plugin’s after logout redirection URL.
swpm_before_login_form_submit_button
This filter can be used to add extra text message and/or input fields to the member login form.
Example Code: Below is an example snippet of code showing how to use this filter.
add_filter('swpm_before_login_form_submit_button', 'login_form_addition');
function login_form_addition($output) {
//Add any extra text message or input fields to the login form output.
$output .= 'This text will show just above the submit button on the login form.';
return $output;
}
Password Reset Related
swpm_email_password_reset_subject
This filter hook can be used to modify the password reset email subject dynamically.
swpm_email_password_reset_body
This filter hook can be used to modify the password reset email body dynamically.
Edit Profile Form Related
swpm_edit_profile_form_before_submit
Use this filter hook to add custom content before the submit button in the ‘Edit Profile’ form.
swpm_fb_edit_profile_form_before_submit
Use this filter hook to add custom content before the submit button in the ‘Edit Profile’ form of the Form Builder addon.
swpm_fb_edit_profile_form_before_fieldset_end
Use this filter hook to add custom content before the fieldset end in the ‘Edit Profile’ form of the Form Builder addon.
Email Activation Feature Related
swpm_activation_feature_override_account_status
This filter hook can be used to override the default account status that is set when the email activation feature is used.
Example Code: Below is an example snippet of code showing how to use this filter.
add_filter('swpm_activation_feature_override_account_status', 'customize_email_activation_acc_status');
function customize_email_activation_acc_status( $status ){
//Set account to pending upon email activation
$status = 'pending';
return $status;
}
Thank You Page Related
swpm_ty_page_registration_msg_with_link
This filter hook can be used to override the default Thank You page message when a unique registration link is displayed.
Example Code: Below is an example snippet of code showing how to use this filter.
add_filter('swpm_ty_page_registration_msg_with_link', 'customize_ty_msg_with_link');
function customize_ty_msg_with_link( $output, $rego_complete_url ){
//Custom output message.
$output = 'My custom output for the thank you page with unique link';
return $output;
}
swpm_ty_page_registration_msg_no_link
This filter hook can be used to override the default Thank You page message when a unique registration link is not displayed.
Example Code: Below is an example snippet of code showing how to use this filter.
add_filter('swpm_ty_page_registration_msg_no_link', 'customize_ty_msg_no_link');
function customize_ty_msg_no_link( $output ){
$output = 'My custom output for the thank you page without unique link';
return $output;
}
Payment Button Related
swpm_payment_button_shortcode_start_output
This filter hook is triggered before the output of the swpm_payment_button shortcode is generated.
Payment Gateway Related
swpm_pp_payment_form_additional_fields
This filter can be used to add extra hidden input fields for the PayPal buy button.
swpm_stripe_sca_session_opts
This filter hook is triggered prior to the creation of a Stripe checkout session. It can be used to update/modify the options array values that will be used in the Stripe session create request.
Below is an example of how to use this filter hook:
add_filter('swpm_stripe_sca_session_opts', 'modify_stripe_co_options', 10, 2);
function modify_stripe_co_options ($options, $button_id){
//The $options array contains the parameters that is used to create the Stripe checkout session.
//Modify the options according to your needs then return it.
return $options;
}