Skip to:
Content
Pages
Categories
Search
Top
Bottom

profile subnav directly link to group page if admin/moderator


  • d4nny
    Participant

    @d4nny

    Hi,

    Was wondering how I can link a new profile subnav that directly opens the group page if the user is a moderator or admin of a group (a user can only be moderator or admin of one group)

    I can add the subnav to profile page but having problem checking for correct group and generating the link!

    Thanks 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

  • shanebp
    Moderator

    @shanebp

    Try something like:

    $group_ids =  groups_get_user_groups( bp_displayed_user_id() ); 
    		
    foreach( $group_ids["groups"] as $id ) { 
    	$group = groups_get_group( array( 'group_id' => $id) );	
    	// var_dump( $group );  // see all the fields
    	$link = bp_get_group_permalink( $group );
    	echo $link;
    }

    d4nny
    Participant

    @d4nny

    thats pretty cool @shanebp 🙂 thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar