Make WordPress Core

Ticket #33481: 33481.patch

File 33481.patch, 964 bytes (added by swissspidy, 9 years ago)

Correctly add the $public_only param. Also fixes the $post_type variable name in the docblock.

  • src/wp-includes/user.php

    diff --git src/wp-includes/user.php src/wp-includes/user.php
    index eae02db..83908c8 100644
    function count_user_posts( $userid, $post_type = 'post', $public_only = false ) 
    277277         *
    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   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
    290290/**