Opened 10 years ago
Closed 10 years ago
#6671 closed defect (bug) (no action required)
New hook request: Added activity item at end of bp_activity_add()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.3.3 |
| Component: | Activity | Keywords: | |
| Cc: |
Description
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.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Alternatively, updating
$r['id']before thebp_activity_addhook would be good:$r['id'] = $activity->id;