Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display custom action in group activity stream tab


  • zaheer01
    Participant

    @zaheer01

    I wan to display my custom created action activities in activity tab of groups but it is displaying in activity tab which is global. I had tried alot of solution on internet but no one is working.

    add_action(‘wp_insert_post’, array($this, ‘bd_custom_bp_record_activity’));
    function bd_custom_bp_record_activity() {

    $gid = bp_get_group_id();
    groups_record_activity(array(
    ‘action’ => apply_filters(‘groups_activity_new_update_action’, sprintf(__(‘%1$s created an event %2$s’, ‘buddypress’), bp_core_get_userlink(get_current_user_id()), ‘‘ . esc_attr(bp_get_group_name()) . ‘‘)),
    ‘content’ => ‘new post’,
    ‘type’ => ‘created_event’,
    ‘item_id’ => $gid,
    ‘user_id’ => get_current_user_id(),
    )
    );
    }

Viewing 2 replies - 1 through 2 (of 2 total)

  • Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    Can you please confirm if you are getting the id of the group in this variable $gid?

    Thanks


    zaheer01
    Participant

    @zaheer01

    You are absolutely right there was issue is group id and i was also putting my code at wrong place in my plugin. Thanks for your response.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar