Make WordPress Core

Changeset 33953


Ignore:
Timestamp:
09/08/2015 08:57:31 PM (9 years ago)
Author:
boonebgorges
Message:

Pass the $public_only value to 'get_usernumposts' filter.

[32523] introduced the $public_only parameter to count_user_posts(). That
changeset was supposed to pass $public_only to the 'get_usernumposts' filter
at the end of the function, but only the documentation was modified, not the
filter itself.

This changeset also fixes an incorrect variable name in the docblock for
the same filter, and includes clarification on the accepted values for
the $post_type parameter.

Merges [33710] and [33716] to the 4.3 branch.

Props swisspidy, tmatsuur, tyxla, DrewAPicture.
Fixes #33481 for 4.3.1.

Location:
branches/4.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.3

  • branches/4.3/src/wp-includes/user.php

    r33620 r33953  
    262262 *
    263263 * @param int          $userid      User ID.
    264  * @param array|string $post_type   Optional. Post type(s) to count the number of posts for. Default 'post'.
     264 * @param array|string $post_type   Optional. Single post type or array of post types to count the number of posts for. Default 'post'.
    265265 * @param bool         $public_only Optional. Whether to only return counts for public posts. Default false.
    266266 * @return int Number of posts the user has written in this post type.
     
    278278     * @since 2.7.0
    279279     * @since 4.1.0 Added `$post_type` argument.
    280      * @since 4.3.0 Added `$public_only` argument.
     280     * @since 4.3.1 Added `$public_only` argument.
    281281     *
    282282     * @param int          $count       The user's post count.
    283283     * @param int          $userid      User ID.
    284      * @param string|array $post_types  Post types to count the number of posts for.
     284     * @param string|array $post_type   Single post type or array of post types to count the number of posts for.
    285285     * @param bool         $public_only Whether to limit counted posts to public posts.
    286286     */
    287     return apply_filters( 'get_usernumposts', $count, $userid, $post_type );
     287    return apply_filters( 'get_usernumposts', $count, $userid, $post_type, $public_only );
    288288}
    289289
Note: See TracChangeset for help on using the changeset viewer.