Streamline support for multiple post types in get_posts_by_author_sql().

* Don't accept a comma-separated list, only a single post type or an array of post types. This is easier to document.
* Add changelog entries to all calling functions.

Props DrewAPicture.
Fixes #32243.

git-svn-id: https://develop.svn.wordpress.org/trunk@32524 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2015-05-21 19:48:19 +00:00
parent e656053bce
commit f0d6031d9b
3 changed files with 9 additions and 9 deletions
@@ -24,7 +24,7 @@ class Tests_Post_GetPostsByAuthorSql extends WP_UnitTestCase {
register_post_type( 'foo' );
register_post_type( 'bar' );
$maybe_string = get_posts_by_author_sql( 'foo,bar' );
$maybe_string = get_posts_by_author_sql( array( 'foo', 'bar' ) );
$this->assertContains( "post_type = 'foo'", $maybe_string );
$this->assertContains( "post_type = 'bar'", $maybe_string );
@@ -135,7 +135,7 @@ class Tests_Post_GetPostsByAuthorSql extends WP_UnitTestCase {
$editor_role->add_cap( 'read_private_baz' );
wp_set_current_user( $u );
$maybe_string = get_posts_by_author_sql( 'foo,bar,baz' );
$maybe_string = get_posts_by_author_sql( array( 'foo', 'bar', 'baz' ) );
$this->assertNotContains( "post_type = 'foo' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );
$this->assertNotContains( "post_type = 'bar' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );
$this->assertContains( "post_type = 'baz' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );