Make WordPress Core


Ignore:
Timestamp:
05/21/2015 07:48:19 PM (10 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/getPostsByAuthorSql.php

    r32523 r32524  
    2525        register_post_type( 'bar' );
    2626
    27         $maybe_string = get_posts_by_author_sql( 'foo,bar' );
     27        $maybe_string = get_posts_by_author_sql( array( 'foo', 'bar' ) );
    2828        $this->assertContains( "post_type = 'foo'", $maybe_string );
    2929        $this->assertContains( "post_type = 'bar'", $maybe_string );
     
    136136        wp_set_current_user( $u );
    137137
    138         $maybe_string = get_posts_by_author_sql( 'foo,bar,baz' );
     138        $maybe_string = get_posts_by_author_sql( array( 'foo', 'bar', 'baz' ) );
    139139        $this->assertNotContains( "post_type = 'foo' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );
    140140        $this->assertNotContains( "post_type = 'bar' AND ( post_status = 'publish' OR post_status = 'private' )", $maybe_string );
Note: See TracChangeset for help on using the changeset viewer.