• Hello,
    I have a buddypress installation and I use the Peters Login Redirect plugin to redirect users by their role to different sections.
    There is a section that I cannot reach. I need a certain type of user to be able to access the documents of their group upon login (each user has a group). I would be missing a variable that would indicate the name of the group depending on the user. I’ve tried everything … Can someone help me?
    mysite.com/gestion/[variable][/variable]/docs

    Mila esker, thanks,

Viewing 1 replies (of 1 total)
  • Plugin Author David Cavins

    (@dcavins)

    Since users can generally belong to multiple groups in BuddyPress, I don’t think there will be a shortcut to the user’s “group.” Your best bet is to do some sort of calculation in php sort of like this:

    $user_group_ids = groups_get_user_groups( get_current_user_id() );
    if ( $user_group_ids ) {
      $first_group_id = current( $user_group_ids ); 
      $group = new BP_Groups_Group( $first_group_id );
      $link = bp_get_group_permalink( $group )
    }
Viewing 1 replies (of 1 total)
  • The topic ‘what is the variable’ is closed to new replies.