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/src/wp-includes/post.php

    r32523 r32524  
    53275327 *
    53285328 * @since 2.2.0
    5329  *
    5330  * @param string|array $post_type Array or comma-separated string of post types.
    5331  *                               Currently only supports 'post' or 'page'.
     5329 * @since 4.3.0 Added the ability to pass an array to `$post_type`.
     5330 *
     5331 * @param string|array $post_type Single post type or an array of post types. Currently only supports 'post' or 'page'.
    53325332 * @return string SQL code that can be added to a where clause.
    53335333 */
     
    53405340 *
    53415341 * @since 3.0.0
    5342  * @since 4.3.0 Introduced the ability to pass multiple post types to `$post_type`.
     5342 * @since 4.3.0 Introduced the ability to pass an array of post types to `$post_type`.
    53435343 *
    53445344 * @see get_private_posts_cap_sql()
    53455345 *
    5346  * @param array|string   $post_type   Array or comma-separated list of post type(s).
     5346 * @param array|string   $post_type   Single post type or an array of post types.
    53475347 * @param bool           $full        Optional. Returns a full WHERE statement instead of just
    53485348 *                                    an 'andalso' term. Default true.
     
    53585358        $post_types = $post_type;
    53595359    } else {
    5360         $post_types = preg_split( '/[\s,]+/', $post_type );
     5360        $post_types = array( $post_type );
    53615361    }
    53625362
Note: See TracChangeset for help on using the changeset viewer.