Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save strangerstudios/8e2483e57062462c84c5fb5e51398ea9 to your computer and use it in GitHub Desktop.
Save strangerstudios/8e2483e57062462c84c5fb5e51398ea9 to your computer and use it in GitHub Desktop.
Redirect the Membership Account page to the bbPress User Profile.
/*
Redirect the Membership Account page to the bbPress User Profile.
*/
function my_pmpro_bbpress_profile_template_redirect()
{
global $pmpro_pages, $current_user;
//make sure PMPro is active
if(empty($pmpro_pages))
return;
//make sure bbPress is active
if(!function_exists('bbp_get_user_profile_url'))
return;
//Redirect the Membership Account page to the bbPress User Profile.
if( is_page($pmpro_pages['account']) )
{
wp_redirect( bbp_get_user_profile_url( bbp_get_current_user_id() ) );
exit;
}
}
add_action('template_redirect', 'my_pmpro_bbpress_profile_template_redirect');
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Set the bbPress User Profile as Membership Account Page" at Paid Memberships Pro here: https://www.paidmembershipspro.com/set-bbpress-user-profile-membership-account-page/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment