[buddypress-trac] [BuddyPress Trac] #6671: New hook request: Added activity item at end of bp_activity_add()

buddypress-trac noreply at wordpress.org
Mon Oct 19 14:33:02 UTC 2015


#6671: New hook request: Added activity item at end of bp_activity_add()
----------------------------------+-----------------------------
 Reporter:  henry.wright          |      Owner:
     Type:  defect (bug)          |     Status:  new
 Priority:  normal                |  Milestone:  Awaiting Review
Component:  Component - Activity  |    Version:  2.3.3
 Severity:  normal                |   Keywords:
----------------------------------+-----------------------------
 At the end of {{{bp_activity_add()}}} there's already a hook {{{do_action(
 'bp_activity_add', $r );}}}. But {{{$r}}} doesn't give us the ID of the
 new activity item. Is it possible to add a new hook? Something like this
 maybe?

 {{{
 /**
          * Fires at the end of the execution of adding a new activity
 item.
          *
          * @since x.x.x
          *
          * @param object $activity The activity item just added.
          */
         do_action( 'bp_activity_add_obj', $activity );
 }}}

 I could use the various {{{bp_groups_posted_update}}},
 {{{bp_activity_comment_posted}}} and {{{bp_activity_posted_update}}} hooks
 to get the ID but doing everything in one place via
 {{{bp_activity_add_obj}}} will make things easier.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6671>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list