Guest User

Untitled

a guest
Apr 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2. /**
  3. * Redirect the Membership Account page to the user's BuddyPress Profile.
  4. *
  5. */
  6. function my_pmpro_buddypress_profile_template_redirect() {
  7. global $pmpro_pages;
  8.  
  9. // Make sure PMPro is active.
  10. if ( empty( $pmpro_pages ) ) {
  11. return;
  12. }
  13.  
  14. // Make sure BuddyPress is active.
  15. if ( ! function_exists( 'bp_loggedin_user_domain' ) ) {
  16. return;
  17. }
  18.  
  19. // Redirect the Membership Account page to the bbPress User Profile.
  20. if ( is_page( $pmpro_pages['account'] ) ) {
  21. wp_redirect( bp_loggedin_user_domain() );
  22. exit;
  23. }
  24. }
  25. add_action( 'template_redirect', 'my_pmpro_buddypress_profile_template_redirect' );
Add Comment
Please, Sign In to add comment