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:
Boone Gorges
2016-01-08 21:51:50 +00:00
parent 05934ebd87
commit b5a4504f7e
2 changed files with 24 additions and 0 deletions
+17
View File
@@ -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
*/