Skip to:
Content
Pages
Categories
Search
Top
Bottom

Retrieve Group id of single activity


  • kokious
    Participant

    @kokious

    Hello,

    How can I programmatically retrieve the Group Id of a single activity (of the group the activity was created in), knowing the activity id?

    Thanks

Viewing 1 replies (of 1 total)

  • Mohd Umar
    Participant

    @mohdumar1654

    Try this,

    $activity = new BP_Activity_Activity( $activity_id );
    if ( is_object( $activity ) && 'activity_update' === $activity->type && 'groups' === $activity->component ) {
    	$group_id = $activity->item_id;
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar