Make WordPress Core


Ignore:
Timestamp:
05/21/2015 07:48:19 PM (11 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/src/wp-includes/user.php

    r32523 r32524  
    252252 * @since 3.0.0
    253253 * @since 4.1.0 Added `$post_type` argument.
    254  * @since 4.3.0 Added `$public_only` argument.
     254 * @since 4.3.0 Added `$public_only` argument. Added the ability to pass an array of post types to `$post_type`.
    255255 *
    256256 * @global wpdb $wpdb WordPress database object for queries.
     
    289289 *
    290290 * @param array        $users       Array of user IDs.
    291  * @param string|array $post_type   Optional. Array or comma-separated list of post types to check. Defaults to 'post'.
     291 * @param string|array $post_type   Optional. Single post type or array of post types to check. Defaults to 'post'.
    292292 * @param bool         $public_only Optional. Only return counts for public posts.  Defaults to false.
    293293 * @return array Amount of posts each user has written.
Note: See TracChangeset for help on using the changeset viewer.