mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 04:34:31 +00:00
Support multiple post types in count_user_posts() and other functions that use get_posts_by_author_sql().
Props nikonratm. Fixes #32243. git-svn-id: https://develop.svn.wordpress.org/trunk@32523 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -78,4 +78,18 @@ class Tests_User_CountUserPosts extends WP_UnitTestCase {
|
||||
public function test_count_user_posts_post_type_cpt() {
|
||||
$this->assertEquals( 3, count_user_posts( self::$user_id, 'wptests_pt' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 32243
|
||||
*/
|
||||
public function test_count_user_posts_with_multiple_post_types() {
|
||||
$this->assertEquals( 7, count_user_posts( self::$user_id, array( 'wptests_pt', 'post' ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 32243
|
||||
*/
|
||||
public function test_count_user_posts_should_ignore_non_existent_post_types() {
|
||||
$this->assertEquals( 4, count_user_posts( self::$user_id, array( 'foo', 'post' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user