mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
Introduce 'author_url' param to WP_Comment_Query.
Props swissspidy. Fixes #35377. git-svn-id: https://develop.svn.wordpress.org/trunk@36224 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -804,6 +804,23 @@ class Tests_Comment_Query extends WP_UnitTestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 35377
|
||||
*/
|
||||
public function test_get_comments_by_author_url() {
|
||||
$c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );
|
||||
$c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );
|
||||
$c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar/baz' ) );
|
||||
|
||||
$comments = get_comments( array(
|
||||
'author_url' => 'http://foo.bar',
|
||||
) );
|
||||
|
||||
$this->assertCount( 2, $comments );
|
||||
$this->assertSame( $c1, (int) $comments[0]->comment_ID );
|
||||
$this->assertSame( $c2, (int) $comments[1]->comment_ID );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 28434
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user