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. Props swisspidy, tmatsuur. Fixes #33481 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@33710 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a679368d8b
commit
6c3449b710
@ -277,14 +277,14 @@ function count_user_posts( $userid, $post_type = 'post', $public_only = false )
|
|||||||
*
|
*
|
||||||
* @since 2.7.0
|
* @since 2.7.0
|
||||||
* @since 4.1.0 Added `$post_type` argument.
|
* @since 4.1.0 Added `$post_type` argument.
|
||||||
* @since 4.3.0 Added `$public_only` argument.
|
* @since 4.3.1 Added `$public_only` argument.
|
||||||
*
|
*
|
||||||
* @param int $count The user's post count.
|
* @param int $count The user's post count.
|
||||||
* @param int $userid User ID.
|
* @param int $userid User ID.
|
||||||
* @param string|array $post_types Post types to count the number of posts for.
|
* @param string|array $post_type Post types to count the number of posts for.
|
||||||
* @param bool $public_only Whether to limit counted posts to public posts.
|
* @param bool $public_only Whether to limit counted posts to public posts.
|
||||||
*/
|
*/
|
||||||
return apply_filters( 'get_usernumposts', $count, $userid, $post_type );
|
return apply_filters( 'get_usernumposts', $count, $userid, $post_type, $public_only );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user