[buddypress-trac] [BuddyPress Trac] #7988: Supply new activity id to bp_activity_add action hook
buddypress-trac
noreply at wordpress.org
Fri Oct 12 04:02:07 UTC 2018
#7988: Supply new activity id to bp_activity_add action hook
-------------------------+------------------------------
Reporter: drywallbmb | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version: 3.0.0
Severity: normal | Resolution:
Keywords: |
-------------------------+------------------------------
Comment (by r-a-y):
Replying to [comment:4 drywallbmb]:
> Yep, I'd hoped to use that one! But there's no guarantee that the code
invoking `bp_activity_add` will then also do `bp_activity_after_save`.
(For example, bbPress calls `bp_activity_add()` directly but then never
invokes that after-save hook anywhere.)
You are guaranteed to get the activity ID if you use the
`'bp_activity_after_save'` even for new activity items.
See https://buddypress.trac.wordpress.org/browser/tags/3.2.0/src/bp-
activity/classes/class-bp-activity-activity.php#L295
Please give it a try.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7988#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list