bp_profile_homepage

Plugin Name: BP Profile as Homepage Description: Logged in users will be redirected to their profile page if they try to move to HomePage anywhere within buddypress installation same as FACEBOOK do.

Description

bp_profile_homepage(); 

And as the user logs out, he/she is redirected to homepage again. This is tested successfully with Wordpress 4.1 and Buddypress 2.1.1 Contributors: j_p_s Author: Jatinder Pal Singh Author URI: http://www.jpsays.com Requires at least: 3.x Tested up to: 4.1 Stable Tag: 1.1 Donate link: Tags: Buddypress,Social,Facebook,login,redirect Version:1.1


Usage

  1. if ( !function_exists( 'bp_profile_homepage' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-profile-as-homepage/bp_profile_as_homepage.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_profile_homepage(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp_profile_as_homepage.php  
  1. function bp_profile_homepage() 
  2. global $bp; 
  3. $selected_role = get_option('bpahp_role_choice'); 
  4. if($selected_role == '') 
  5. if(is_user_logged_in() && is_front_page()) 
  6. wp_redirect( $bp->loggedin_user->domain ); 
  7. else 
  8. if(!current_user_can($selected_role) && is_front_page()) 
  9. wp_redirect( $bp->loggedin_user->domain );