[wp-trac] [WordPress Trac] #35090: Query for comments where post isn't set
WordPress Trac
noreply at wordpress.org
Tue Dec 15 01:29:14 UTC 2015
#35090: Query for comments where post isn't set
-----------------------------+-------------------------
Reporter: danielbachhuber | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.5
Component: Comments | Version:
Severity: normal | Keywords: needs-patch
Focuses: |
-----------------------------+-------------------------
`WP_Comment_Query` should support querying for comments where `post=0`
This isn't currently supported because of this conditional:
{{{
$post_id = absint( $this->query_vars['post_id'] );
if ( ! empty( $post_id ) ) {
$this->sql_clauses['where']['post_id'] = $wpdb->prepare(
'comment_post_ID = %d', $post_id );
}
}}}
Related
We'll need to accommodate for #34956, as comments with `post=''` should be
considered equivalent to `post=0`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35090>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list