[buddypress-trac] [BuddyPress Trac] #5333: new_blog_post activity items not deleted when blog post is deleted
buddypress-trac
noreply at wordpress.org
Mon Jan 13 16:12:49 UTC 2014
#5333: new_blog_post activity items not deleted when blog post is deleted
--------------------------+--------------------
Reporter: henry.wright | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.0
Component: Activity | Version: 1.9.1
Severity: normal | Resolution:
Keywords: |
--------------------------+--------------------
Comment (by henry.wright):
Replying to [comment:2 boonebgorges]:
> We should think about hooking to 'transition_post_type' instead.
agreed - although I'm not familiar with that hook?
My initial thought was to do this:
{{{add_action( 'trashed_post', 'bp_blogs_remove_post' );}}}
But then I thought, wait, what if a post author decides to untrash a post?
So, perhaps a better solution would be to avoid using the
{{{bp_blogs_remove_post}}} function when a post is trashed and instead
modify the activity item so that it is hidden from the stream.
This can be done easily for the sitewide stream by passing the activity
item's ID to {{{bp_activity_add()}}} and setting {{{hide_sitewide =>
true}}}. Not sure if there is a similar param available which could be
used to hide from the user's activity stream?
This general approach could also work for when a post is unpublished and
republished etc.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5333#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list