[buddypress-trac] [BuddyPress] #4304: Post trash management suggestion
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Tue Jun 26 17:59:46 UTC 2012
#4304: Post trash management suggestion
-------------------------+-----------------------------
Reporter: imath | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Blogs | Version: 1.6-beta
Severity: normal | Keywords:
-------------------------+-----------------------------
Hi,
(sorry 4 my english)
I was working on bp checkins and having hard times with the management of
the trash of my custom post type. Then i made some test on regular posts
on BP 1.5.6 and i noticed that the problem i faced with my custom post
type actually exists for regular post.
I explain :
if i publish a post then this post is commented, if i trash the post, the
'new_blog_post' type activity is deleted but not the activities of the
comments.
So while the post is in trash and not deleted if somebody clicks on the
action of the comments activities, then we get a 404.
So my suggestion is to hook 'trashed_post_comments' to delete the
'new_blog_comment' activities of the blog post trashed.
If the admin change his mind, and remove the blog post from trash, then we
can hook 'untrashed_post_comments' to recreate the 'new_blog_comment'
activities we've deleted after trash.
Finally as, the recording of new_blog_post use the post_modified_gmt date,
i suggest to hook 'untrash_post' to save in a global that the post is
restored (in the diff i've chosen to create $bp->blogs->post_restored
then when the activity recording for this post is called, if
$bp->blogs->post_restored is set it's a restored post, so we can use
post_date_gmt to make sure the comments who will be restored won't be
older than the post.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4304>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list