[wp-trac] [WordPress Trac] #29612: Query for multiple comment statuses
WordPress Trac
noreply at wordpress.org
Wed Sep 10 04:08:28 UTC 2014
#29612: Query for multiple comment statuses
-------------------------+-----------------------------
Reporter: ebinnion | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 4.0
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
I am currently working on a project where I need to query both trashed and
approved comments. Currently, I am doing this by calling get_comments
twice and then merging the results.
I think it would be more ideal if a developer could query for multiple
comment statuses by passing in an array of statuses.
For example:
{{{
$comments = get_comments(
array(
'status' => array( 'trash', 'approve' )
)
);
}}}
My use case is that I want to show trashed comments (with a "This comment
was trashed notice' ) as well as approved comments in an effort to better
preserve conversation threads. Here is an example:
[[Image(https://i.cloudup.com/LZowG5KNS9-1200x1200.png)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29612>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list