Redirect use to pmpro membership page instead of my membership screen in profile

Please add the given code in your wplms-customizer.php file at the end before ” ?> ” in wplms customizer plugin  :

add_action('bp_setup_nav','bphelp_remove_membership_from_profile',999999);
add_action( 'bp_setup_nav', 'add_membership_setup_nav',9999 );

function bphelp_remove_membership_from_profile(){
bp_core_remove_nav_item('membership-account');

}

function add_membership_setup_nav() {
global $bp;
bp_core_new_nav_item( array(
'name' => __( 'My Membership', 'buddypress' ),
'slug'=> 'my-profile-memberships',
'position' => 80,
'screen_function' => 'redirect_to_pmpro_account',
'show_for_displayed_user' => false
) );
}

function redirect_to_pmpro_account(){
  $account_slug=get_permalink(get_option('pmpro_account_page_id'));
  wp_redirect($account_slug);
  exit();
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *