Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get Group_ID from Group Name?

  • @davewoodbridge

    Participant

    Hi,

    Is there a BP function that returns the group_id value when fed the group_name value? I’ve been trying to use bp_get_group_id() and bp_group_id(), but I don’t think I’m using them properly.

    I want to be able to say

    $group_id = bp_get_grou_id(“mygroupname”);

    … and have it assign the group_id for “mygroupname” to $group_id.

    Should be easy, yes?

Viewing 3 replies - 1 through 3 (of 3 total)
  • @apeatling

    Keymaster

    $group_id = BP_Groups_Group::group_exists($group_slug)

    Not technically named for what you want to do, but it does the job. I will add a better named function for this.

    @sirspacey

    Member

    Any word on a better function for this?

    @djpaul

    Keymaster

    BP_Groups_Group::group_exists returns the group ID, from the group name. A better named function isn’t going to improve the functionality.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get Group_ID from Group Name?’ is closed to new replies.
Skip to toolbar