Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save itsjusteileen/dbb6ced36ebcd60c4f31f7bc00664c57 to your computer and use it in GitHub Desktop.
Save itsjusteileen/dbb6ced36ebcd60c4f31f7bc00664c57 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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment