[buddypress-trac] [BuddyPress Trac] #6323: Unable to get user ID of activity items before they are deleted

buddypress-trac noreply at wordpress.org
Thu Mar 26 21:15:02 UTC 2015


#6323: Unable to get user ID of activity items before they are deleted
----------------------------------+------------------
 Reporter:  johnjamesjacoby       |       Owner:
     Type:  enhancement           |      Status:  new
 Priority:  high                  |   Milestone:  2.3
Component:  Component - Activity  |     Version:  1.1
 Severity:  normal                |  Resolution:
 Keywords:                        |
----------------------------------+------------------

Comment (by johnjamesjacoby):

 A few improvements to `BP_Activity_Activity::delete()` will fix this:

 * Select `*` instead of `id`
 * `wp_list_pluck()` the ID's out of the results
 * `do_action_ref_array()` on the array of activity items about to be
 deleted
 * Recursively call `BP_Activity_Activity::delete()` on all activity
 comments so this action is repeatedly fired correctly
 * Get rid of the `extract()` call while we are in there
 * Note that `BP_Activity_Activity ::delete_activity_item_comments()` is
 not used. This method is from the olden days of Activity, before the mptt
 approach and when comments were part of the Wire component.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6323#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list