Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get Permalink From Group ID?

  • I would like to be able to get the permalink of group by passing an ID.

    echo bp_group_permalink(); will return the permalink of the *current* group. But I am looking to do something like:

    bp_group_permalink( ‘ 14 ‘ ); // where 14 is the ID of the group.

    How do you get the permalink (or slug) of a group using the ID?

    Thanks!

Viewing 1 replies (of 1 total)
  • Avatar of myvahid
    myvahid
    Participant

    @myvahid

    This should work

    $group = groups_get_group( array( 'group_id' => $group_id ) );
    $group_permalink = trailingslash*t( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' ) );

    replace *=i

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.