Filter Hooks in MemberPress
Here you can find the list of the most common filter hooks divided into sections that you can find and use in MemberPress.
If you want to learn more about hooks please check out Actions and Filters in MemberPress article.
Rules
- mepr-pre-run-rule-content
- mepr-pre-run-rule-redirection
- mepr-last-chance-to-block-content
- mepr-rule-redirect-unauthorized-url
Signup
- mepr-validate-signup
- mepr-signup-styles
- mepr-signup-scripts
- mepr-signup-checkout-url
- mepr_render_custom_fields
- mepr_product_access_string
- mepr-stripe-checkout-element-style
- mepr-stripe-form-hide-postal-code
- mepr-is-product-page
- mepr-product-url
Admin
- mepr-admin-members-cols
- mepr-admin-subscriptions-cols
- mepr-admin-transactions-sortable-cols
- mepr_user_subscriptions_query_cols
- mepr-admin-transactions-cols
- mepr_nonrecurring_subscriptions_table_joins
- mepr_nonrecurring_subscriptions_table_cols
- mepr_recurring_subscriptions_table_joins
- mepr_recurring_subscriptions_table_cols
- mepr_import_subscription_pre_store
- mepr_import_subscription_post_store
- mepr_user_subscriptions_customize_subscription
Account Page
- mepr-account-welcome-message
- mepr-user-message
- mepr-account-nav-home-link
- mepr-account-nav-subscriptions-link
- mepr-account-nav-payments-link
- mepr-account-nav-home-label
- mepr-account-nav-subscriptions-label
- mepr-account-nav-payments-label
- mepr-account-payment-product-name
- mepr-account-subscr-product-name
- mepr-validate-account
- mepr-active-nav-tab
- mepr_custom_upgrade_link_txn
- mepr-product-renewal-string
- mepr_payments_per_page
- mepr_is_account_page
Login
- mepr-login-redirect-url
- mepr-process-login-redirect-url
- mepr-login-uname-or-email-str
- mepr-login-uname-str
- mepr-unauthorized-login-link-text
- mepr-auto-login
Emails
- mepr-wp-mail-recipients
- mepr-wp-mail-subject
- mepr-wp-mail-message
- mepr-wp-mail-headers
- mepr_reminder_email_params
- mepr_reminder_email_vars
- mepr_subscription_email_params
- mepr_subscription_email_vars
Invoice
Miscellaneous
- mepr-hide-cpt-access-column
- mepr_fetch_options
- mepr_checkout_show_terms
- mepr_custom_cancel_link
- mepr-currency-symbols
- mepr-currency-codes
- mepr-language-codes
- mepr_countries
- mepr-jobs-config
- mepr-admin-capability
- mepr_price_box_benefit
- mepr-group-css-classes-string
- mepr-group-page-item-output
- mepr_custom_thankyou_message
- mepr_user_pw_reset_title
- mepr_admin_pw_reset_title
- mepr-userroles-add-roles
- mepr-userroles-remove-roles
- mepr_reminder_lookup
Courses
mepr-pre-run-rule-content
Description
Parameters
$current_post WP_Post
$uri String
Example
Unprotect MemberPress posts if they have a certain category
add_filter('mepr-pre-run-rule-content', 'mepr_override_content_protection', 11, 3); function mepr_override_content_protection($protect, $post, $uri) { if(has_category('category_slug_here', $post)) { $protect = false; } return $protect; }
mepr-pre-run-rule-redirection
Description
Parameters
$uri String
$delim String
Example
Unprotect MemberPress posts if they have a certain category
add_filter('mepr-pre-run-rule-redirection', 'mepr_override_redirection_protection', 11, 3); function mepr_override_redirection_protection($protect, $uri, $delim) { global $post; //$post - may not be availble here if not using "template_redirect" as the redirect action in MemberPress Options if(!isset($post) || !($post instanceof WP_Post)) { return $protect; } $user = MeprUtils::get_currentuserinfo(); if($user === false) { return $protect; } $registration_date = strtotime(MeprUser::get_user_registration_date($user->ID)) - MeprUtils::months(1); $post_date = strtotime($post->post_date); $active_product_subscriptions = $user->active_product_subscriptions(); if(!empty($active_product_subscriptions) && $post_date >= $registration_date) { return false; // Don't protect the content } return $protect; }
mepr-last-chance-to-block-content
Description
Parameters
$current_post WP_Post
$uri String
mepr-rule-redirect-unauthorized-url
Description
Redirect unauthorized visitors to different page than global unuthorized page
Parameters
$delim String
$uri String
Example
Redirect unauthorized visitors for particular page
function mepr_single_redirect($redirect_url, $delim, $uri) { global $post; if($post->ID === 2) { $redirect_url = "https://your-domain.com/new-page{$delim}mepr-unauth-page={$post->ID}&redirect_to=".urlencode($uri); } return $redirect_url; } add_filter('mepr-rule-redirect-unauthorized-url', 'mepr_single_redirect', 10, 3);
mepr-validate-signup
Description
It is used to validate signup fields
Parameters
Example
Limit Signups to USA only
function limit_signups_to_one_country($errors) { if(!isset($_POST['mepr-address-country']) || $_POST['mepr-address-country'] != 'US') { $errors[] = 'Sorry, signups are currently limited to USA only.'; } return $errors; } add_filter('mepr-validate-signup', 'limit_signups_to_one_country');
mepr-signup-styles
Description
Add custom style to signup page
Parameters
$prereqs Array
Example
function mepr_signup_styles($prereqs) { // Do what you need return $prereqs; } add_filter('mepr-signup-styles', 'mepr_signup_styles');
mepr-signup-scripts
Description
Add custom script to signup or account page
Parameters
$prereqs Array
$is_product_page Boolean
$is_account_page Boolean
Example
function mepr_signup_scripts($prereqs, $is_product_page, $is_account_page) { // Do what you need return $prereqs; } add_filter('mepr-signup-scripts', 'mepr_signup_scripts', 10, 3);
function validate_invisible_recaptcha_mepr_signup($errors) { $is_valid = apply_filters('google_invre_is_valid_request_filter', true); if(!$is_valid) { $errors[] = "Failed Captcha"; } return $errors; } add_filter('mepr-validate-signup', 'validate_invisible_recaptcha_mepr_signup');
mepr-signup-checkout-url
Description
It is used to change signup checkout URL
Parameters
$txn Transaction object
Example
function mepr_signup_checkout_url($url, $txn) { // Do what you need return $url; } add_filter('mepr-signup-checkout-url', 'mepr_signup_checkout_url', 11, 2);
mepr_render_custom_fields
Description
Re-order custom fields on the signup page
Parameters
$custom_fields Array
Example
function moveElement(&$array, $a, $b) { $out = array_splice($array, $a, 1); array_splice($array, $b, 0, $out); } function mepr_render_custom_fields_fn($custom_fields) { moveElement($custom_fields, 5, 2); return $custom_fields; } add_filter('mepr_render_custom_fields', 'mepr_render_custom_fields_fn');
mepr_product_access_string
Description
Change message displayed on the registration page when a user has already subscribed to this membership
Parameters
$prd Membership Object
Example
function mepr_custom_product_access_string($prd) { $echo = preg_replace('/you have already subscribed to this item/i', 'Custom message', $prd); $echo = preg_replace('/click here to access it/i', 'Custom text link', $echo); return $echo; } add_filter('mepr_product_access_string', 'mepr_custom_product_access_string');
mepr-stripe-checkout-element-style
Description
Change default styling of Stripe fields
Parameters
$style Array
Example
Increase the font size of Stripe credit card field
function mepr_increase_stripe_cc($style) { $style['base']['fontSize'] = '18px'; return $style; } add_filter('mepr-stripe-checkout-element-style', 'mepr_increase_stripe_cc');
mepr-stripe-form-hide-postal-code
Description
Remove postal code from Stripe field
Parameters
$hide Boolean
Example
function mepr_hide_post_code_stripe_elements($hide) { return true; } add_filter('mepr-stripe-form-hide-postal-code', 'mepr_hide_post_code_stripe_elements');
mepr-is-product-page
Description
Enqueue scripts for custom membership pages. It is needed if someone has phone field issue with our scripts missing
Parameters
$return Boolean
$post Post Object
Example
function mepr_is_product_page($return, $post) { $custom_pages = array(2710); if(isset($post) && in_array($post->ID, $custom_pages)) { return true; } return $return; } add_filter('mepr-is-product-page', 'mepr_is_product_page', 10, 2);
mepr-product-url
Description
Set custom page with [mepr-membership-registration-form] shortcode as membership page. That will update all links in the Account page, so they no longer point to default registration page.
Parameters
$url String
$product Membership Object
$args Array
$modify_if_https Boolean
Example
function mepr_custom_membership_urls($url, $product, $args, $modify_if_https) { if($product->ID === 123) { $url = 'https://your-domain.com/professional-membership/'; }; if($product->ID === 456) { $url = 'https://your-domain.com/basic-membership/'; }; return $url; } add_filter('mepr-product-url', 'mepr_custom_membership_urls', 10, 4);
mepr-admin-members-cols
Description
It allows you to add a custom column to MemberPress → Members page.
Parameters
$cols Array
Example
function mepr_admin_members_cols($cols) { // Do what you need return $cols; } add_filter('mepr-admin-members-cols', 'mepr_admin_members_cols');
mepr-admin-subscriptions-cols
Description
Add column to the Admin site
Parameters
$cols Array
$prefix String
$lifetime String
Example
function mepr_add_admin_subscriptions_cols($cols, $prefix, $lifetime) { $cols[$prefix.'site'] = 'Site'; return $cols; } add_filter('mepr-admin-subscriptions-cols', 'mepr_add_admin_subscriptions_cols', 10, 3);
mepr_user_subscriptions_query_cols
Description
It is used to fetch additional columns from user's subscription
Parameters
Example
function mepr_user_subscriptions_query_cols($cols) { //Do what you need return $cols; } add_filter('mepr_user_subscriptions_query_cols', 'mepr_user_subscriptions_query_cols');
mepr-admin-transactions-cols
Description
Add column to the Admin Transactions table
Parameters
$cols Array
Example
function mepr_add_admin_transactions_cols($cols) { // Add your column here return $cols; } add_filter('mepr-admin-transactions-cols', 'mepr_add_admin_transactions_cols');
mepr-admin-transactions-sortable-cols
Description
Add sortable column to the Admin Transactions table
Parameters
$cols Array
Example
function mepr_admin_transactions_sortable_cols($cols) { // Add your column here return $cols; } add_filter('mepr_admin_transactions_sortable_cols', 'mepr-admin-transactions-sortable-cols');
mepr_nonrecurring_subscriptions_table_joins
Description
It is used to modify join query to fetch from non-recurring subscriptions table
Parameters
Example
function mepr_nonrecurring_subscriptions_table_joins($joins) { //Do what you need return $joins; } add_filter('mepr_nonrecurring_subscriptions_table_joins', 'mepr_nonrecurring_subscriptions_table_joins');
mepr_nonrecurring_subscriptions_table_cols
Description
It is used to modify columns fetched from non-recurring subscriptions table
Parameters
Example
function mepr_nonrecurring_subscriptions_table_cols($cols) { //Do what you need return $cols; } add_filter('mepr_nonrecurring_subscriptions_table_cols', 'mepr_nonrecurring_subscriptions_table_cols');
mepr_recurring_subscriptions_table_joins
Description
It is used to modify join query to fetch from recurring subscriptions table
Parameters
Example
function mepr_recurring_subscriptions_table_joins($joins) { //Do what you need return $joins; } add_filter('mepr_recurring_subscriptions_table_joins', 'mepr_recurring_subscriptions_table_joins');
mepr_recurring_subscriptions_table_cols
Description
It is used to modify columns fetched from subscriptions table
Parameters
Example
function mepr_recurring_subscriptions_table_cols($cols) { //Do what you need return $cols; } add_filter('mepr_recurring_subscriptions_table_cols', 'mepr_recurring_subscriptions_table_cols');
mepr_import_subscription_pre_store
Description
It is used to modify subscription in Importer before it is stored
Parameters
Example
function mepr_import_subscription_pre_store($sub_id) { //Do what you need } add_filter('mepr_import_subscription_pre_store', 'mepr_import_subscription_pre_store');
mepr_import_subscription_post_store
Description
It is used to modify subscription in Importer after it is stored
Parameters
Example
function mepr_import_subscription_post_store($sub_id) { //Do what you need } add_filter('mepr_import_subscription_post_store', 'mepr_import_subscription_post_store');
mepr_user_subscriptions_customize_subscription
Description
It is used to filter through the subscriptions. It is called inside foreach loop.
Parameters
$row Subscription for each item in the loop
$user User object
Example
function mepr_customize_subscription($sub, $row, $user) { //Do what you need } add_filter('mepr_user_subscriptions_customize_subscription', 'mepr_customize_subscription', 10, 3);
mepr-account-welcome-message
Description
Change welcome message on the Account page
Parameters
$message String
$user User Object
Example
function mepr_account_welcome_message($message, $user) { // Do what you need return message; } add_filter('mepr-account-welcome-message', 'mepr_account_welcome_message', 10, 2);
mepr-user-message
Description
Change user message on the Account page
Parameters
$message String
$user User Object
Example
function mepr_account_user_message($message, $user) { // Do what you need return message; } add_filter('mepr-user-message', 'mepr_account_user_message', 10, 2);
mepr-account-nav-home-link
Description
Change the link of the Home tab of the Account page
Example
function mepr_account_nav_home_link() { // Return your link } add_filter('mepr-account-nav-home-link', 'mepr_account_nav_home_link');
mepr-account-nav-subscriptions-link
Description
Change the link of the Subscriptions tab of the Account page
Example
function mepr_account_nav_subscriptions_link() { // Return your link } add_filter('mepr-account-nav-subscriptions-link', 'mepr_account_nav_subscriptions_link');
mepr-account-nav-payments-link
Description
Change the link of the Payments tab of the Account page
Example
function mepr_account_nav_payments_link() { // Return your link } add_filter('mepr-account-nav-payments-link', 'mepr_account_nav_payments_link');
mepr-account-nav-home-label
Description
Change the label of the Subscriptions tab of the Account page
Example
function mepr_account_nav_home_label() { // Return a new label } add_filter('mepr-account-nav-home-label', 'mepr_account_nav_home_label');
mepr-account-nav-subscriptions-label
Description
Change the label of the Subscriptions tab of the Account page and the Subscriptions label in the message that appears on this page if there are any issues with user subscriptions
Example
function mepr_account_nav_subscriptions_label() { // Return a new label } add_filter('mepr-account-nav-subscriptions-label', 'mepr_account_nav_subscriptions_label');
mepr-account-nav-payments-label
Description
Change the label of the Payments tab of the Account page
Example
function mepr_account_nav_payments_label() { // Return a new label } add_filter('mepr-account-nav-payments-label', 'mepr_account_nav_payments_label');
mepr-account-payment-product-name
Description
Change Membersip Title in the Membership column. It is in the Payments tab of the Account page
Parameters
$membership_title String
$txn Transaction Object
Example
function mepr_account_payment_product_name($membership_title, $txn) { // Do what you need return $membership_title; } add_filter('mepr-account-payment-product-name', 'mepr_account_payment_product_name', 10, 2);
mepr-account-subscr-product-name
Description
Change Membersip Title in the Membership column. It is in the Subscriptions tab of the Account page
Parameters
$membership_title String
$txn Transaction Object
Example
function mepr_account_subscr_product_name($membership_title, $txn) { // Do what you need return $membership_title; } add_filter('mepr-account-subscr-product-name', 'mepr_account_subscr_product_name', 10, 2);
mepr-validate-account
Description
It is used to validate fields on the Account page
Parameters
$user User object
Example
Validate Display Name field to MemberPresss account page
function mpdn_validate_on_account($errors, $user) { if(!isset($_POST['mepr_user_display_name']) || empty($_POST['mepr_user_display_name'])) { $errors[] = "You must enter a Public Display Name"; return $errors; } $display_name = stripslashes($_POST['mepr_user_display_name']); $new_email = stripslashes($_POST['user_email']); $old_email = $user->user_email; $username = $user->user_login; if($display_name == $new_email || $display_name == $old_email) { $errors[] = "Your Public Display Name cannot be the same as your Email Address"; } if($display_name == $username) { $errors[] = "Your Public Display Name cannot be the same as your Username"; } return $errors; } add_filter('mepr-validate-account', 'mpdn_validate_on_account', 11, 2);
mepr-active-nav-tab
Description
Change navigation class of tabs on the Account page
Parameters
$class String
$tab String
$active_class String
Example
function mepr_active_nav_tab($class, $tab, $active_class) { // Do what you need return $class; } add_filter('mepr-active-nav-tab', 'mepr_active_nav_tab', 10, 3);
mepr_custom_upgrade_link_txn
Description
Add content after Change Plan of Subscriptions tab of the Account page
Parameters
$html String
$txn Transaction Object
Example
function mepr_custom_upgrade_link_txn_fn($html, $txn) { // Do what you need return $html; } add_filter('mepr_custom_upgrade_link_txn', 'mepr_custom_upgrade_link_txn_fn', 10, 2);
mepr-product-renewal-string
Description
Change renewal price display string for one-time payment. Note: This does not change the actual renewal price.
Parameters
$renewal_str String
$product Membership Object
Example
Change renewal price display string for membership with ID 207
function mepr_product_renewal_price($renewal_str, $product) { if($product->ID === 207) { $renewal_str = ' (<strong>Special offer</strong> for renewal)'; } return $renewal_str; } add_filter('mepr-product-renewal-string', 'mepr_product_renewal_price', 2, 10);
mepr_payments_per_page
Description
Example
function mepr_payments_per_page() { return 10; } add_filter('mepr_payments_per_page', 'mepr_payments_per_page');
mepr_is_account_page
Description
Add custom account page so all MemberPress scripts are enqueued
Parameters
$is_account Boolean
$post Post Object
Example
function mepr_is_account_page_fn($is_account_page, $post) { if(is_page(354)) { return true; }; return $is_account_page; } add_filter('mepr_is_account_page', 'mepr_is_account_page_fn', 10, 2);
mepr-login-redirect-url
Description
Change URL to redirect member after login. This redirect will be overwritten with per membership redirect URL settings
Parameters
$url String
Example
function mepr_login_redirect_url($url) { // Do what you need return $url; } add_filter('mepr-login-redirect-url', 'mepr_login_redirect_url');
mepr-process-login-redirect-url
Description
Change URL to redirect member after login. It replaces global and per membership Login URL settings
Parameters
$url String
$user User Object
Example
Redirect member to URL after login
function mepr_process_login_redirect_url_fn($url, $user) { $roles = $user->roles; if($roles && false !== array_search('author', $roles)) { $url = 'https://your_domain.com'; } return $url; } add_filter('mepr-process-login-redirect-url', 'mepr_process_login_redirect_url_fn', 11, 2);
mepr-login-uname-or-email-str
Description
Change Username or E-mail label on the Login page that is displaying when "Members must use their email address for their Username" option is enabled
Example
function mepr_login_uname_or_email_str() { return 'New Username or E-mail Label'; } add_filter('mepr-login-uname-or-email-str', 'mepr_login_uname_or_email_str');
mepr-login-uname-str
Description
Change Username label on the Login page
Example
function mepr_login_uname_str() { return 'New Username Label'; } add_filter('mepr-login-uname-str', 'mepr_login_uname_str');
mepr-unauthorized-login-link-text
Description
Change Login link text in unauthorized message
Example
function mepr-unauthorized-login-link-text() { return 'New Login Link'; } add_filter('mepr-unauthorized-login-link-text', 'mepr-unauthorized-login-link-text');
mepr-auto-login
Description
Control whether new user is automatically logged in
Parameters
$auto_login Boolean
$membership_id Membership Object
$mepr_user User Object
Example
function mepr_disable_auto_login($auto_login, $membership_id, $mepr_user) { return false; } add_filter('mepr-auto-login', 'mepr_disable_auto_login', 10, 3);
mepr-wp-mail-recipients
Description
Change email recipients
Parameters
$recipients Array
$subject String
$message String
$headers Array
Example
function mepr_wp_mail_recipients($recipients, $subject, $message, $headers) { // Do what you need return $recipients; } add_filter('mepr-wp-mail-recipients', 'mepr_wp_mail_recipients', 10, 4);
mepr-wp-mail-subject
Description
Change email subject
Parameters
$subject String
$recipients Array
$message String
$headers Array
Example
function mepr_wp_mail_subject($subject, $recipients, $message, $headers) { // Do what you need return $subject; } add_filter('mepr-wp-mail-subject', 'mepr_wp_mail_subject', 10, 4);
mepr-wp-mail-message
Description
Change email message
Parameters
$message String
$recipients Array
$subject String
$headers Array
Example
function mepr_wp_mail_message($message, $recipients, $subject, $headers) { // Do what you need return $message; } add_filter('mepr-wp-mail-message', 'mepr_wp_mail_message', 10, 4);
mepr-wp-mail-headers
Description
Change email header
Parameters
$headers Array
$recipients Array
$subject String
$message String
$attachments Array
Example
Add CC to all emails
function mepr_wp_mail_headers($headers, $recipients, $subject, $message, $attachments) { $cc_email = sanitize_email('[email protected]'); $headers[] = 'Cc: ' . $cc_email; return $headers; } add_filter('mepr-wp-mail-headers', 'mepr_wp_mail_headers', 10, 5);
mepr_reminder_email_params
Description
Modify values return from reminder email parameters
Parameters
$params Array
$reminder Reminder Object
Example
function mepr_reminder_email_params_fn($params, $reminder) { // Do what you need return $params; } add_filter('mepr_reminder_email_params', 'mepr_reminder_email_params_fn', 10, 2);
mepr_reminder_email_vars
Description
Modify reminder email parameters variables
Parameters
$vars Array
$reminder Reminder Object
Example
function mepr_reminder_email_vars_fn($vars, $reminder) { // Do what you need return $vars; } add_filter('mepr_reminder_email_vars', 'mepr_reminder_email_vars_fn', 10, 2);
mepr_subscription_email_params
Description
Modify values return from email parameters
Parameters
$params Array
$sub Subscription Object
Example
function mepr_subscription_email_params_fn($params, $sub) { // Do what you need return $params; } add_filter('mepr_subscription_email_params', 'mepr_subscription_email_params_fn', 10, 2);
mepr_subscription_email_vars
Description
Modify email parameters variables
Parameters
$vars Array
Example
function mepr_subscription_email_vars_fn($vars) { // Do what you need return $vars; } add_filter('mepr_subscription_email_vars', 'mepr_subscription_email_vars_fn');
mepr-pdf-invoice-data
Description
Modify invoice parameters generated by PDF Invoice Add-on
Parameters
$invoice Invoice Object
$txn Transaction Object
Example
Change the invoice's description
function mepr_change_invoice_desc($invoice, $txn) { $prd = $txn->product(); $invoice['items'][0]['description'] = $prd->post_title; return $invoice; } add_filter('mepr-pdf-invoice-data', 'mepr_change_invoice_desc', 10, 2);
mepr_pdf_invoice_filename
Description
Change the file name when an invoice is downloaded.
Parameters
$file_name Filename of PDF invoice
Example
add_filter('mepr_pdf_invoice_filename', function($file_name) { $file_name = 'mepr_txn_invoice.pdf'; return $file_name; }, 10, 1);
mepr-hide-cpt-access-column
Description
Remove Access column in the Custom Post Types pages in dashboard
Parameters
$except Array of CPT' names
Example
function mepr_hide_cpt_access_column($except) { // Do what you need return $prereqs; } add_filter('mepr-hide-cpt-access-column', 'mepr_hide_cpt_access_column');
mepr_fetch_options
Description
It is used to filter fetched MemberPress options
Parameters
Example
Remove the State Field completely (it requires more code to function properly)
function trim_down_address_fields($options) { foreach($options->address_fields as $i => $o) { if($o->field_key == 'mepr-address-state') { unset($options->address_fields[$i]); } } return $options; } add_filter('mepr_fetch_options', 'trim_down_address_fields');
mepr_checkout_show_terms
Description
Show price terms in the Signup form
Parameters
$show_price Boolean
Example
Hide price terms on Signup pages
function mepr_checkout_show_terms_fn($show_price) { return false; } add_filter('mepr_checkout_show_terms', 'mepr_checkout_show_terms_fn');
mepr_custom_cancel_link
Description
It is used to change MemberPress Cancel URL in Actions column of the Accout page
Parameters
$sub Subscription object
Example
Hijack MemberPress Cancel URL (it requires more code to function properly)
function cspf_custom_cancel_link($html, $sub) { ob_start(); ?> <a href="?action=upsell&sub=<?php echo $sub->id; ?>">Cancel</a> <?php return ob_get_clean(); } add_action('mepr_custom_cancel_link', 'cspf_custom_cancel_link', 10, 2);
mepr-currency-symbols
Description
Change the list of "Currency Symbol" in the MemberPress General settings
Parameters
$codes Array
Example
function mepr_currency_symbols($codes) { $new_code = array('৳'); array_splice( $codes, 4, 0, $new_code ); return $codes; } add_filter('mepr-currency-symbols', 'mepr_currency_symbols');
mepr-currency-codes
Description
Change the list of "Currency Code" in the MemberPress General settings
Parameters
$codes Array
Example
function mepr_currency_codes($codes) { $new_code = array('BDT'); array_splice( $codes, 4, 0, $new_code ); return $codes; } add_filter('mepr-currency-codes', 'mepr_currency_codes');
mepr-language-codes
Description
Change the list of "Language Code" in the MemberPress General settings
Parameters
$codes Array
Example
function mepr_language_codes($codes) { $new_code = array('BN'); array_splice( $codes, 4, 0, $new_code ); return $codes; } add_filter('mepr-language-codes', 'mepr_language_codes');
mepr_countries
Description
Change the list of countries in the singup page
Parameters
$countries Array
$prioritize_my_country Boolean
Example
Leave Germany as the only country in the dropdown list on the signup page
function mepr_countries_fn($countries, $prioritize_my_country) { return array( 'DE' => _x('Germany', 'ui', 'memberpress') ); } add_filter('mepr_countries', 'mepr_countries_fn', 10, 2);
mepr-jobs-config
Description
Change default WP Cron job configuration object
Parameters
$config Object
Example
function mepr_jobs_config($config) { $config['worker']['interval'] = MeprUtils::minutes(30); return (object)$config; } add_filter('mepr-jobs-config', 'mepr_jobs_config');
mepr-admin-capability
Description
Change default MemberPress capability to display MemberPress menu items
Parameters
$cap String
Example
function mepr_admin_capability($cap) { // Do what you need return $cap; } add_filter('mepr-admin-capability', 'mepr_admin_capability');
mepr_price_box_benefit
Description
Change item in the list of Group benefits
Parameters
$element String
$index Number
Example
function mepr_price_box_benefit_fn($element, $index) { // Do what you need return $element; } add_filter('mepr_price_box_benefit', 'mepr_price_box_benefit_fn', 10, 2);
mepr-group-css-classes-string
Description
Change class of the Group price box
Parameters
$classes String
$product Membership Object
$group Group Object
$preview Boolean
Example
function mepr_group_css_classes_string($classes, $product, $group, $preview) { // Do what you need return $classes; } add_filter('mepr-group-css-classes-string', 'mepr_group_css_classes_string', 10, 4);
mepr-group-page-item-output
Description
Change the Group box item
Parameters
$output String
$product Membership Object
$group Group Object
$preview Boolean
Example
function mepr_group_page_item_output($output, $product, $group, $preview) { // Do what you need return $output; } add_filter('mepr-group-page-item-output', 'mepr_group_page_item_output', 10, 4);
mepr_custom_thankyou_message
Description
Change custom Thank You page message
Parameters
$message String
Example
function mepr_custom_thankyou_message_fn($message) { // Do what you need return $message; } add_filter('mepr_custom_thankyou_message', 'mepr_custom_thankyou_message_fn');
mepr_user_pw_reset_title
Description
Example
function mepr_user_pw_reset_title() { return 10; } add_filter('mepr_user_pw_reset_title', 'mepr_user_pw_reset_title');
mepr_admin_pw_reset_title
Description
Example
function mepr_admin_pw_reset_title() { return 10; } add_filter('mepr_admin_pw_reset_title', 'mepr_admin_pw_reset_title');
mepr-userroles-add-roles
Description
Add role to user when subscription is active
Parameters
$roles_user_should_have Array
$wp_user User Object
Example
function mepr_userroles_add_roles($roles_user_should_have, $wp_user) { array_push($roles_user_should_have, 'custom_role'); return $roles_user_should_have; } add_filter('mepr-userroles-remove-roles', 'mepr_userroles_remove_roles', 10, 2);
mepr-userroles-remove-roles
Description
Remove role from user when when status of subscription changes
Parameters
$roles_to_remove Array
$wp_user User Object
Example
function mepr_userroles_remove_roles($roles_to_remove, $wp_user) { // Do what you need return $roles_to_remove; } add_filter('mepr-userroles-remove-roles', 'mepr_userroles_remove_roles', 10, 2);
mepr_reminder_lookup
Description
Change reminder name and description
Parameters
$lookup Array
$reminder Array of reminders
Example
function mepr_reminder_lookup_fn($lookup, $reminder) { $lookup['member-signup']['after']['name'] = $reminder->post_title; $lookup['member-signup']['before']['name'] = $reminder->post_title; return $lookup; } add_filter('mepr_reminder_lookup', 'mepr_reminder_lookup_fn', 10, 2);
mpcs_courses_per_page
Description
Example
function mpcs_courses_per_page() { return 10; } add_filter('mpcs_courses_per_page', 'mpcs_courses_per_page');
mpcs_classroom_style_handles
Description
Parameters
$allowed_handles Array of allowed stylesheet handles
Example
add_filter('mpcs_classroom_style_handles', function($allowed_handles){ $allowed_handles[] = 'YOUR_STYLE_HANDLE_HERE'; return $allowed_handles; });
Note: If you are using a page builder like Elementor and MemberPress Classroom mode is enabled, please read our article on How to Edit Lessons in Classroom Mode with a Page Builder.