Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Redirect the Membership Account page to the user's BuddyPress Profile.
- *
- */
- function my_pmpro_buddypress_profile_template_redirect() {
- global $pmpro_pages;
- // Make sure PMPro is active.
- if ( empty( $pmpro_pages ) ) {
- return;
- }
- // Make sure BuddyPress is active.
- if ( ! function_exists( 'bp_loggedin_user_domain' ) ) {
- return;
- }
- // Redirect the Membership Account page to the bbPress User Profile.
- if ( is_page( $pmpro_pages['account'] ) ) {
- wp_redirect( bp_loggedin_user_domain() );
- exit;
- }
- }
- add_action( 'template_redirect', 'my_pmpro_buddypress_profile_template_redirect' );
Add Comment
Please, Sign In to add comment