mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user