#2059 closed defect (bug) (fixed)
bbp_delete_topic is not deleting the child replies
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | major | Version: | 2.2 |
Component: | Tools - Code Improvements | Keywords: | has-patch commit |
Cc: | wordpress@… |
Description
The query generated by the WP_Query in there looks like:
SELECT wp_posts.ID, wp_posts.post_parent FROM wp_posts WHERE 1=1 AND wp_posts.post_parent = 93 AND wp_posts.post_type = 'reply' AND (wp_posts.post_status <> 'trash' AND wp_posts.post_status <> 'auto-draft' AND wp_posts.post_status <> 'spam' AND wp_posts.post_status <> 'orphan' AND wp_posts.post_status <> 'hidden') ORDER BY wp_posts.post_date DESC
It seems the post_status => any is getting lost somehow.
I'm on WordPress 3.5 trunk
Attachments (2)
Change History (13)
#3
@
11 years ago
- Component changed from Topics to Code Improvement
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 2.3
Looks like the safest thing we can do here is include an array of every single post status that's possible for these to have. Being explicit appears to override any of the additional checks that WP_Query::get_posts() does.
I see two usages of post_status 'any' that would need this.
#4
@
11 years ago
Makes sense. I'll take a pass next week. So,
[publish] => publish [future] => future [draft] => draft [pending] => pending [private] => private [trash] => trash [auto-draft] => auto-draft [inherit] => inherit
Probably all, right?
#8
@
11 years ago
get_post_stati returns the bbp stati too:
Array ( [0] => publish [1] => future [2] => draft [3] => pending [4] => private [5] => trash [6] => auto-draft [7] => inherit [8] => closed [9] => spam [10] => orphan [11] => hidden )
Note: See
TracTickets for help on using
tickets.
Interesting! The post_status=>any won't work for us. get_post excludes all the stati that has 'exclude_from_search':
... more code ...
... more code ...
... more code ...
... more code ...
so, the $this->is_admin is not kicking in when post_status=>any