Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to retrieve Group Id for single activity


  • kokious
    Participant

    @kokious

    Hello,

    I am trying to find a way to programmatically retrieve the group id of a single activity. I want to set a body class containing the group id the activity belongs to, within the activity inner page.

    Any help?

    Thanks

Viewing 1 replies (of 1 total)

  • mohdumar1654
    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