Uses
Uses | Description |
---|---|
wp-includes/user.php: count_user_posts() | Number of posts user has written. |
wp-includes/post.php: get_post() | Retrieves post data given a post ID or post object. |
Retrieve the number of posts by the author of the current post.
(int) The number of posts by the author.
File: wp-includes/author-template.php
function get_the_author_posts() { $post = get_post(); if ( ! $post ) { return 0; } return count_user_posts( $post->post_author, $post->post_type ); }
Version | Description |
---|---|
1.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_the_author_posts