Opened 3 years ago
Closed 3 years ago
#12766 closed defect (bug) (fixed)
commentmeta data orphaned when deleting a post from the trash
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Comments | Version: | |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: | briancolinger@…, me@… |
Description
Adding $force_delete param to wp_delete_comment().
wp_delete_post() will now delete each comment individually using wp_delete_comment() with the $force_delete param set to true.
This fixes and issue where related commentmeta is orphaned when deleting a post from the trash.
Attachments (3)
Change History (12)
briancolinger — 3 years ago
briancolinger — 3 years ago
comment:1
briancolinger — 3 years ago
- Cc briancolinger@… added
Why the switch to post_parent. Seems that would delete comments from the wrong post.
comment:4
briancolinger — 3 years ago
@ryan, you are correct, that seems to be a data loss bug. I'll fix it and re-post a patch.
briancolinger — 3 years ago
comment:6
briancolinger — 3 years ago
I've switched back to $postid instead of post_parent. I've tested this patch and it does not cause comments from the wrong post to be deleted like the last patch did!
Is it possible for someone to delete the comment.php and post.php patches that i submitted earlier?
- Cc me@… added
- Keywords has-patch needs-testing added; needs-patch removed

Also, #11470