Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Different BP profile landing page for different user role


  • had_hc
    Participant

    @had_hc

    Hi all, i’m trying to set different BP profile landing page for different user roles.

    Here’s what i’ve tried;

    function bp_default_tab (){
    	global $bp;
            if ( bp_is_user() ) {
    	$wcv_profile_info = get_userdata( bp_displayed_user_id() );
    	if ( $wcv_profile_info->roles[0] == "vendor" ){
    				 define('BP_DEFAULT_COMPONENT', 'my-store' );
    			} else {
    				define('BP_DEFAULT_COMPONENT', 'following' );
    			}
            }
    }
    add_action( 'bp_loaded', 'bp_default_tab' );
    

    With this code, landing profile change only set to the ‘else’ (following in regards to code above). Couldn’t manage to change for the ‘vendor’ user role. Anybody have any idea how?
    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Different BP profile landing page for different user role’ is closed to new replies.
Skip to toolbar