[wp-trac] [WordPress Trac] #35090: Query for comments where post isn't set
WordPress Trac
noreply at wordpress.org
Tue Dec 15 01:32:23 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 | Resolution:
Keywords: has-patch has-unit-tests dev-feedback | Focuses:
---------------------------------------------------+------------------
Changes (by danielbachhuber):
* keywords: needs-patch => has-patch has-unit-tests dev-feedback
Comment:
I don't fully understand the unit test added by @boonebgorges in r30402:
{{{
public function test_query_post_id_0() {
$c1 = self::factory()->comment->create( array( 'comment_post_ID'
=> $this->post_id, 'comment_approved' => '1' ) );
$q = new WP_Comment_Query();
$found = $q->query( array(
'post_id' => 0,
'fields' => 'ids',
) );
$this->assertEqualSets( array( $c1 ), $found );
}
}}}
Why would we return all comments if `post_id=0`?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35090#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list