get_usernumposts хук-фильтр . WP 2.7.0
Filters the number of posts a user has written.
Использование
add_filter( 'get_usernumposts', 'filter_function_name_1609', 10, 4 ); function filter_function_name_1609( $count, $userid, $post_type, $public_only ){ // filter... return $count; }
- $count(число)
- The user's post count.
- $userid(число)
- User ID.
- $post_type(строка/массив)
- Single post type or array of post types to count the number of posts for.
- $public_only(true/false)
- Whether to limit counted posts to public posts.
Список изменений
С версии 2.7.0 | Введена. |
С версии 4.1.0 | Added $post_type argument. |
С версии 4.3.1 | Added $public_only argument. |
Где вызывается хук
get_usernumposts
wp-includes/user.php 568
return apply_filters( 'get_usernumposts', $count, $userid, $post_type, $public_only );