get_the_author_posts
Retrieve the number of posts by the author of the current post.
Description
(int) get_the_author_posts();
Returns (int)
The number of posts by the author.
Usage
if ( !function_exists( 'get_the_author_posts' ) ) { require_once ABSPATH . WPINC . '/author-template.php'; } // NOTICE! Understand what this does before running. $result = get_the_author_posts();
Defined (1)
The function is defined in the following location(s).
- /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 );
- }