Action Hooks in MemberPress

Here you can find the list of the most common action 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.

Checkout Form

Subscriptions & Transactions

Account Page

Login Page

Memberships Page

Coupons Page

Miscellaneous

mepr-above-checkout-form

Description

It is used on registration page and allows you to add custom code above the registration form

Parameters

$membership_id Number

Example

function mepr_content_above_registration_form($membership_id) {
    // Put your content here
}

add_action('mepr-above-checkout-form', 'mepr_content_above_registration_form');

mepr-checkout-before-name

Description

It is used on registration form above the first and last name

Parameters

$membership_id Number

Example

function mepr_content_above_name($membership_id) {
    // Put your content here
}

add_action('mepr-checkout-before-name', 'mepr_content_above_name');

mepr-checkout-after-email-field

Description

Add Email Validation Field to MemberPress checkout form

Parameters

$membership_id Number

Example

<?php
function display_validate_email_field($membership_id) {
    ?>
    <div class="mp-form-row mepr_validate_email">
        <div class="mp-form-label">
            <label><?php _ex('Verify Email:*', 'ui', 'memberpress'); ?</label>
            <span class="cc-error"><?php _ex('Invalid Email', 'ui', 'memberpress'); ?></span>
        </div>
        <input type="email" name="user_validate_email" id="user_validate_email" class="mepr-form-input" value="" required />
    </div>
    <?php
}
add_action('mepr-checkout-after-email-field', 'display_validate_email_field');

mepr-checkout-after-password-fields

Description

It is used on registration form below password fields

Parameters

$membership_id Number

Example

add_action('mepr-checkout-after-password-fields', 'mepr_content_after_password');
function mepr_content_after_password($membership_id) {
    // Put your content here
}

mepr-checkout-before-coupon-field

Description

It is used on registration form above coupon

Parameters

$membership_id Number

Example

Add website field before coupon field (it requires more code for saving)

function mepr_add_website_field($membership_id) {
  ?>
    <div class="mp-form-row mepr_website_field">
      <div class="mp-form-label">
        <label>Website:*</label>
    </div>
      <input type="text" name="mepr_website_field" id="mepr_website_field" class="mepr-form-input" value="<?php echo (isset($_POST['mepr_website_field']))?stripslashes($_POST['mepr_website_field']):''; ?>" />
    </div>
    <?php
}
add_action('mepr-before-coupon-field', 'mepr_add_website_field');

mepr-checkout-before-submit

Description

It is used on registration form above submit button

Parameters

$membership_id Number

Example

Integrates MemberPress with https://wordpress.org/plugins/invisible-recaptcha/

function add_invisible_recaptcha_mepr_signup($membership_ID) { ?>
    <div class="mp-form-row mepr_invisible_recaptcha">
        <?php do_action('google_invre_render_widget_action'); ?>
    </div>
<?php
}
add_action('mepr-checkout-before-submit', 'add_invisible_recaptcha_mepr_signup');

mepr-signup

Description

It is used for processing the signup form before the logic progresses on to 'the_content'

Parameters

$txn Transaction Object

Example

Activates UPME profiles when a user signs up via MemberPress

function mepr_upme_activate($txn) {
  update_user_meta($txn->user_id, 'upme_activation_status', 'ACTIVE');
  update_user_meta($txn->user_id, 'upme_approval_status', 'ACTIVE');
  update_user_meta($txn->user_id, 'upme_user_profile_status', 'ACTIVE');
  upme_update_user_cache($txn->user_id);
}
add_action('mepr-signup', 'mepr_upme_activate'); //Use this if you don't want to wait for completed payment

mepr-save-account

Description

It is used on saving of the main Account page on front-end

Parameters

$user User Object

Example

Save new display name on Account page

function mpdn_save_account($user) {
  $display_name = stripslashes($_POST['mepr_user_display_name']);
  $user->display_name = $display_name;
  $user->store();

  //Set the nickname to the display name also, why not?
  update_user_meta($user->ID, 'nickname', $display_name);
}
add_action('mepr-save-account', 'mpdn_save_account');

mepr-event-create

Description

Do things when a user becomes active on a membership, and when they become inactive on a membership

Parameters

$event Event Object

Example

function listen_to_mepr_events($event) {
  $obj = $event->get_data();
  //$obj might be a MeprTransaction object or a MeprSubscription object

  if(!($obj instanceof MeprTransaction) && !($obj instanceof MeprSubscription)) {
    return; // nothing here to do if we're not dealing with a txn or sub
  }

  $member = $obj->user();

  if($member->is_active_on_membership($obj)) {
    //member is active on membership
  }
  else {
    //member is no longer active on this membership
  }
}
add_action('mepr-event-create', 'listen_to_mepr_events');

mepr-event-login

Description

Remove State Field from MemberPress Signup Forms

Parameters

$event Event Object

Example

//Remove the State Field completely
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');

//Add a fake state value to each user
function populate_state_field($event) {
  $user = $event->get_data();
  update_user_meta($user->ID, 'mepr-address-state', 'fake');
}
add_action('mepr-event-login', 'populate_state_field');

mepr-event-member-signup-completed

Description

Capture a new member signup. Only ever triggers once for each new member. Does not trigger for exising members who have subscribed to a Membership before. The user may not be logged in when this is called as it is triggered when a user is added over the REST API, and also when a user is added from the dashboard (MemberPress -> Members -> Add New)

Parameters

$event Event Object

Example

function mepr_capture_new_member_signup_completed($event) {
  $user = $event->get_data();
  $txn_data = json_decode($event->args);
  //Do what you need
}
add_action('mepr-event-member-signup-completed', 'mepr_capture_new_member_signup_completed');

mepr-event-transaction-completed

Description

Example

Capture any completed transaction (recurring and non-recurring) event

Parameters

$event Event Object

function catch_first_payment_after_trial($event) {
  $transaction = $event->get_data();
  $subscription = $transaction->subscription();
  $is_first_real_payment = false;

  if($subscription !== false) {
    if($subscription->trial && $subscription->trial_amount <= 0.00 && $subscription->txn_count == 1) {
      $is_first_real_payment = true;
    }
    elseif($subscription->trial && $subscription->trial_amount > 0.00 && $subscription->txn_count == 2) {
      $is_first_real_payment = true;
    }
  }

  if($is_first_real_payment) {
    // This is the first real payment after a paid or free trial period
    // So do what you will in here
  }
}
add_action('mepr-event-transaction-completed', 'catch_first_payment_after_trial');

mepr-event-recurring-transaction-failed

Description

Capture a failed Transaction event

Parameters

$event Event Object

Example

function mepr_capture_failed_transaction($event) {
  $transaction = $event->get_data();
  $subscription = $transaction->subscription();
  $user = $transaction->user();
  //Do what you need
}
add_action('mepr-event-recurring-transaction-failed', 'mepr_capture_failed_transaction');

mepr-event-non-recurring-transaction-completed

Description

Capture a new One-Time Subscription created event

Parameters

$event Event Object

Example

function mepr_capture_new_one_time_sub($event) {
  $transaction = $event->get_data();
  $user = $transaction->user();
  //Do what you need
}
add_action('mepr-event-non-recurring-transaction-completed', 'mepr_capture_new_one_time_sub');

mepr-event-transaction-refunded

Description

Capture a refunded Transaction event

Parameters

$event Event Object

Example

function mepr_capture_refunded_transaction($event) {
  $transaction = $event->get_data();
  $subscription = $transaction->subscription(); //This may return false if it's a one-time transaction that was refunded
  $user = $transaction->user();
  //Do what you need
}
add_action('mepr-event-transaction-refunded', 'mepr_capture_refunded_transaction');

mepr-event-transaction-expired

Description

Capture a Transaction expired event

Parameters

$event Event Object

Example

function mepr_capture_expired_transaction($event) {
  //BE CAREFUL WITH THIS ONE
  //This could be a prior recurring transaction that has expired
  //So the user might still be active on the subscription with a new transaction
  //So you might check
  // - if the $subscription exists
  // - if so, then is $subscription->status = 'active' still
  // - if so, then it's possible the user is not really expired on it
  //   - to check this use the $user->is_already_subscribed_to($transaction->product_id) method
  $transaction = $event->get_data();
  $subscription = $transaction->subscription(); //This may return false if it's a one-time transaction that has expired
  $user = $transaction->user();
  //Do what you need
}
add_action('mepr-event-transaction-expired', 'mepr_capture_expired_transaction');

mepr-event-subscription-created

Description

Capture a new Recurring Subscription created event

Parameters

$event Event Object

Example

function mepr_capture_new_recurring_sub($event) {
  $subscription = $event->get_data();
  $user = $subscription->user();
  //Do what you need
}
add_action('mepr-event-subscription-created', 'mepr_capture_new_recurring_sub');

mepr-event-subscription-paused

Description

Capture a Recurring Subscription paused event

Parameters

$event Event Object

Example

function mepr_capture_paused_sub($event) {
  $subscription = $event->get_data();
  $user = $subscription->user();
  //Do what you need
}
add_action('mepr-event-subscription-paused', 'mepr_capture_paused_sub');

mepr-event-subscription-resumed

Description

Capture a Recurring Subscription resumed event

Parameters

$event Event Object

Example

function mepr_capture_resumed_sub($event) {
  $subscription = $event->get_data();
  $user = $subscription->user();
  //Do what you need
}
add_action('mepr-event-subscription-resumed', 'mepr_capture_resumed_sub');

mepr-event-subscription-stopped

Description

Capture a Recurring Subscription cancelled event (and detect who did it)

Parameters

$event Event Object

Example

function mepr_capture_stopped_sub($event) {
  $subscription = $event->get_data();
  $user = $subscription->user();

  if(is_user_logged_in()) {
    if(current_user_can('manage_options')) {
      //An admin cancelled this from the dashboard
    }
    else {
      //User cancelled from their account page or upgraded to a new plan
    }
  }
  else {
    //Cancelled from a gateway Webhook or IPN notification
    //Not really a way to tell why but it could have been an
    // - admin cancelling it at the gateway instead of in the dashboard
    // - or the gateway could have cancelled it because of too many failed payments
    // - or the gateway could have cancelled it because the max billing cycles was reached
    // - or in the case of PayPal a user might have cancelled their recurring profile from in their PayPal account
  }
}
add_action('mepr-event-subscription-stopped', 'mepr_capture_stopped_sub');

mepr-event-member-added

Description

Capture a signup (user completed step 1, but hasn't necessarily paid yet)

Parameters

$event Event Object

Example

function mepr_capture_new_member_added($event) {
  $user = $event->get_data();
  //Do what you need
}
add_action('mepr-event-member-added', 'mepr_capture_new_member_added');

mepr_subscription_transition_status

Description

Capture when the status of subscription is changed during signup or updating subscription

Parameters

$old_status String
$new_status String
$sub Subscription Object

Example

function mepr_subscription_transition_status_fn($old_status, $new_status, $sub) {
  // Do what you need
}
add_action('mepr_subscription_transition_status', 'mepr_subscription_transition_status_fn', 10, 3);

mepr-txn-transition-status

Description

Capture after transaction is done processing

Parameters

$old_status String
$new_status String
$txn Transaction Object

Example

function mepr_txn_transition_status_fn($old_status, $new_status, $txv) {
  // Do what you need
}
add_action('mepr-txn-transition-status', 'mepr_txn_transition_status_fn', 10, 3);

mepr-txn-status-complete

Description

Called after completed payment

Parameters

$event Transaction Object

Example

Activate UPME profile when a user signs up via MemberPress

function mepr_upme_activate($txn) {
  update_user_meta($txn->user_id, 'upme_activation_status', 'ACTIVE');
  update_user_meta($txn->user_id, 'upme_approval_status', 'ACTIVE');
  update_user_meta($txn->user_id, 'upme_user_profile_status', 'ACTIVE');
  upme_update_user_cache($txn->user_id);
}
add_action('mepr-txn-status-complete', 'mepr_upme_activate');

mepr-txn-store

Description

Called after transaction is done processing including the subscr txn_count

Parameters

$txn Transaction Object
$old_txn Transaction Object

Example

function mepr_txn_store_fn($txn, $old_txn) {
  // Do what you need
}
add_action('mepr-txn-store', 'mepr_txn_store_fn', 10, 2);

mepr-transaction-expired

Description

Called when transaction expires

Parameters

$txn Transaction Object
$status Boolean

Example

Show or hide UserPro profile based on subscription status

function mepr_sync_user_pro_visibility($txn, $status = false) {
  global $userpro;

  if(class_exists('MeprUser')) {
    $user = new MeprUser($txn->user_id);

    //Make sure it's a valid user still
    if(!isset($user->ID) || !$user->ID) { return; }

    $subs = $user->active_product_subscriptions();

    if(!empty($subs)) {
      $userpro->unblock_account($user->ID);
    }
    else {
      $userpro->block_account($user->ID);
    }
  }
}
add_action('mepr-txn-expired', 'mepr_sync_user_pro_visibility', 10, 2);

mepr-admin-subscriptions-cell

Description

It is used to add column to Subscriptions page on admin side

Parameters

$column_name String
$rec Transaction Object
$table Subscription Table Object
$attributes String

Example

(it requires more code to function properly)

function mepr_add_admin_subscriptions_cell($column_name, $rec, $table, $attributes) {
  $user = new MeprUser($rec->user_id);

  if(strpos($column_name, '_site') !== false && (int)$user->ID > 0) {
    $website = 'None';
    $website_fields = get_user_meta($user->ID, 'mepr_custom_website_fields', true);

    if($website_fields) {
      foreach($website_fields as $f) {
        if(!$table->lifetime && $rec->ID == $f['sub_id']) {
          $website = $f['website'];
          break;
        }
        elseif($table->lifetime && $rec->ID == $f['txn_id']) {
          $website = $f['website'];
          break;
        }
      }
    } ?>
      <td <?php echo $attributes; ?>><?php echo $website; ?></td>
    <?php
  }
}
add_action('mepr-admin-subscriptions-cell', 'mepr_add_admin_subscriptions_cell', 10, 4);

mepr-admin-transactions-cell

Description

It is used to add column to Transactions page on admin side

Parameters

$column_name String
$rec Transaction Object
$attributes String

Example

function mepr_add_admin_transactions_cell($column_name, $rec, $attributes) {
  // Do what you need
}
add_action('mepr-admin-transactions-cell', 'mepr_add_admin_transactions_cell', 10, 3);

mepr-account-home-before-name

Description

Add content to the Home tab of the Account page before First Name field

Parameters

$user User Object

Example

function mepr_account_home_before_name($user) {
  // Do what you need
}
 add_action('mepr-account-home-before-name', 'mepr_account_home_before_name');

mepr-account-home-fields

Description

Add content to the Home tab of the Account page before Save Profile button

Parameters

$user User Object

Example

(it requires more code to function properly)

function mpdn_show_on_account($user) {
  ?>
    <div class="mp-form-row">
      <div class="mp-form-label">
        <label>Display Name Publically As:*<br/><small>Must be different than your username and email address</small></label>
      </div>
      <input type="text" name="mepr_user_display_name" id="mepr_user_display_name" class="mepr-form-input mepr-display-name" value="<?php echo $user->display_name; ?>" />
    </div>
    <?php
}
add_action('mepr-account-home-fields', 'mpdn_show_on_account');

mepr_account_home

Description

Add content at the end of the Home tab of the Account page

Parameters

$user User Object

Example

function mepr_account_home($user) {
  // Do what you need
}
 add_action('mepr_account_home', 'mepr_account_home');

mepr_account_nav

Description

It is used to add navigation item to the navigation of Account page

Parameters

$action String

Example

function mepr_add_some_tabs($action) {
  $support_active = (isset($_GET['action']) && $_GET['action'] == 'premium-support')?'mepr-active-nav-tab':'';
  ?>
    <span class="mepr-nav-item premium-support <?php echo $support_active; ?>">
      <a href="/account/?action=premium-support">Premium Support</a>
    </span>
    <?php
}
add_action('mepr_account_nav', 'mepr_add_some_tabs');

mepr_account_nav_content

Description

It is used to add the content to the new tab on the Account page

Parameters

$action String

Example

function mepr_add_tabs_content($action) {
  if($action == 'premium-support'): //Update this 'premium-support' to match what you put above (?action=premium-support)
  ?>
    <div id="custom-support-form">
      <form action="" method="post">
        <label for="subject">Enter Subject:</label><br/>
        <input type="text" name="subject" id="subject" />

        <br/><br/>

        <label for="content">Enter Content:</label><br/>
        <input type="text" name="content" id="content" />

        <br/><br/>

        <input type="submit" name="premium-support-submit" value="Submit" />
      </form>
    </div>
    <?php
  endif;
}
add_action('mepr_account_nav_content', 'mepr_add_tabs_content');

mepr-account-after-password-fields

Description

Add content to the Change password form of the Account page before Submit button

Parameters

$user User Object

Example

function mepr_account_after_password_fields($user) {
  // Add HTML code here
}
add_action('mepr-account-after-password-fields', 'mepr_account_after_password_fields');

mepr_account_password

Description

Add content at the end of the Change password form on the Account page

Parameters

$user User Object

Example

function mepr_account_password($user) {
  // Add HTML code here
}
add_action('mepr_account_password', 'mepr_account_password');

mepr_account_payments_table_header

Description

Add column at the end of the Payments tab of the Account page

Example

function mepr_account_payments_table_header() {
  ?>
  <th><?php _ex('Custom Info', 'ui', 'memberpress'); ?></th>
  <?php
}
add_action('mepr_account_payments_table_header', 'mepr_account_payments_table_header');

mepr_account_payments_table_row

Description

Add additional field at the end of the Payments tab of the Account page

Parameters

$txn Transaction Object

Example

function mepr_account_payments_table_row($txn) {
  // Do what you need
}
add_action('mepr_account_payments_table_row', 'mepr_account_payments_table_row');

mepr_account_payments

Description

Add content at the end of the Payments tab of the Account page

Parameters

$user User Object

Example

function mepr_account_payments($user) {
  // Do what you need
}
add_action('mepr_account_payments', 'mepr_account_payments');

mepr_before_account_subscriptions

Description

Add content at the beginning of the Subscriptions tab on the Account page

Parameters

$user User Object

Example

function mepr_before_account_subscriptions($user) {
  // Add HTML code here
}
add_action('mepr_before_account_subscriptions', 'mepr_before_account_subscriptions');

mepr-account-subscriptions-th

Description

It is used to display label in a new column in Subscriptions tab of the Account page

Example

(it requires more code to function properly)

function mepr_add_subscriptions_th($user, $subs) {
  ?>
    <th>Site</th>
    <?php
}
add_action('mepr-account-subscriptions-th', 'mepr_add_subscriptions_th', 10, 2);

mepr_account_subscriptions_sub_account_auto_rebill

Description

Add content to the Sub Account in the Subscription field of the Subscriptions tab on the Account page

Parameters

$txn Transaction Object

Example

function mepr_account_subscriptions_sub_account_auto_rebill_fn($txn) {
  // Add HTML code here
}
add_action('mepr_account_subscriptions_sub_account_auto_rebill', 'mepr_account_subscriptions_sub_account_auto_rebill_fn');

mepr_account_subscriptions_sub_account_terms

Description

Add content below the Subscription field of the Subscriptions tab on the Account page

Parameters

$txn Transaction Object

Example

function mepr_account_subscriptions_sub_account_terms_fn($txn) {
  // Add HTML code here
}
add_action('mepr_account_subscriptions_sub_account_terms', 'mepr_account_subscriptions_sub_account_terms_fn');

mepr-account-subscriptions-actions

Description

Add content below actions columns in the Subscriptions tab on the Account page

Parameters

$user User Object
$sub Subscription Object
$txn Transaction Object
$is_sub Boolean

Example

function mepr_account_subscriptions_actions($user, $sub, $txn, $is_sub) {
  // Add HTML code here
}
add_action('mepr-account-subscriptions-actions', 'mepr_account_subscriptions_actions', 10, 4);

mepr-account-subscriptions-td

Description

It is used to populate field in a new column in Subscriptions tab of the Account page

Example

(it requires more code to function properly)

function mepr_add_subscriptions_td($user, $sub, $txn, $is_recurring) {
  $website = 'None';
  $website_fields = get_user_meta($user->ID, 'mepr_custom_website_fields', true);

  if($website_fields) {
    foreach($website_fields as $f) {
      if($is_recurring && $sub->ID == $f['sub_id']) {
        $website = $f['website'];
        break;
      }
      elseif(!$is_recurring && $txn->id == $f['txn_id']) {
        $website = $f['website'];
        break;
      }
    }
  } ?>
    <td data-label="Website">
      <div class="mepr-account-website"><?php echo $website; ?></div>
    </td>
    <?php
}
add_action('mepr-account-subscriptions-td', 'mepr_add_subscriptions_td', 10, 4);

mepr-account-subscriptions-table

Description

Add row at the end of the Subscriptions table on the Account page

Parameters

$user User Object
$subscription Subscription Object

Example

function mepr_account_subscriptions_table($user, $subscription) {
  // Add HTML code here
}
add_action('mepr-account-subscriptions-table', 'mepr_account_subscriptions_table', 10, 2);

mepr_account_subscriptions

Description

Add content at the end of the Subscriptions tab on the Account page

Parameters

$user User Object

Example

function mepr_account_subscriptions($user) {
  // Add HTML code here
}
add_action('mepr_account_subscriptions', 'mepr_account_subscriptions');

mepr-login-form-before-submit

Description

Add content before Remember Me checkbox on the Login page

Example

function mepr_login_form_before_submit() {
  // Add HTML code here
}
add_action('mepr-login-form-before-submit', 'mepr_login_form_before_submit');

mepr-forgot-password-form

Description

Add content before Submit button on the Forgot Login Password page

Example

function mepr_forgot_password_form() {
  // Add HTML code here
}
add_action('mepr-forgot-password-form', 'mepr_forgot_password_form');

mepr-reset-password-after-password-fields

Description

Add content after Password field on the Reset Login Password page

Example

function mepr_reset_password_after_password_fields() {
  // Add HTML code here
}
add_action('mepr-reset-password-after-password-fields', 'mepr_reset_password_after_password_fields');

mepr-membership-meta-boxes

Description

Add meta box to the Membership

Parameters

$membership Membership Object

Example

function mepr_membership_meta_boxes_fn($membership) {
  // Do what you need
}
add_action('mepr-membership-meta-boxes', 'mepr_membership_meta_boxes_fn');

mepr-membership-save-meta

Description

Do what you need once membership is saving

Parameters

$txn Membership Object

Example

function mepr_membership_save_meta_fn($membership) {
  // Do what you need
}
add_action('mepr-membership-save-meta', 'mepr_membership_save_meta_fn');

mepr_members_list_table_row

Description

Display custom column in Members table

Parameters

$attributes String
$rec Object
$column_name String
$column_display_name String

Example

function mepr_members_list_table_row_fn($attributes, $rec, $column_name, $column_display_name) {
  // Display content
}
add_action('mepr_members_list_table_row', 'mepr_members_list_table_row_fn', 10, 4);

mepr-coupon-meta-boxes

Description

Add meta box to the Coupon edit page

Parameters

$coupon Coupon Object

Example

function mepr_coupon_meta_boxes_fn($coupon) {
  // Do what you need
}
add_action('mepr-coupon-meta-boxes', 'mepr_coupon_meta_boxes_fn');

mepr-coupon-save-meta

Description

Do what you need once coupon is saving

Parameters

$coupon Coupon Object

Example

function mepr_coupon_save_meta_fn($coupon) {
  // Do what you need
}
add_action('mepr-coupon-save-meta', 'mepr_coupon_save_meta_fn');

mepr-coupon-admin-enqueue-script

Description

Enqueue custom script on the Coupon edit page

Parameters

$hook String

Example

function mepr_coupon_admin_enqueue_script_fn($hook) {
  // Do what you need
}
add_action('mepr-coupon-admin-enqueue-script', 'mepr_coupon_admin_enqueue_script_fn');

mepr-account-is-active

Description

Do what you need when new transaction comes and is active

Parameters

$txn Transaction Object

Example

function mepr_account_is_active($txn) {
  // Do what you need
}
add_action('mepr-account-is-active', 'mepr_account_is_active');

mepr-account-is-inactive

Description

Do what you need when new transaction comes and is inactive

Parameters

$txn Transaction Object

Example

function mepr_account_is_inactive($txn) {
  // Do what you need
}
add_action('mepr-account-is-inactive', 'mepr_account_is_inactive');

mepr_menu

Description

Add submenu after Analytics submenu in the Dashboard

Example

function mepr_menu_fn() {
  // Add HTML code here
}
add_action('mepr_menu', 'mepr_menu_fn');

mepr_enqueue_scripts

Description

Enqueue custom script on MemberPress front-end pages like Membership page, Group page or Account page

Parameters

$is_product_page Boolean
$is_group_page Boolean
$is_account_page Boolean

Example

function mepr_enqueue_scripts($is_product_page, $is_group_page, $is_account_page) {
  // Do what you need
}
add_action('mepr_enqueue_scripts', 'mepr_enqueue_scripts', 10, 3);

mepr_payment_failure

Description

Do what you need when payment fails and error comes up

Parameters

$txn Transaction Object

Example

function mepr_payment_failure_fn($txn) {
  // Do what you need
}
add_action('mepr_payment_failure', 'mepr_payment_failure_fn');
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.