get_the_author_posts()WP 1.5.0

Retrieves the number of posts by the author of the current post.

No Hooks.

Return

Int. The number of posts by the author.

Usage

get_the_author_posts();

Changelog

Since 1.5.0 Introduced.

get_the_author_posts() code WP 6.6.2

function get_the_author_posts() {
	$post = get_post();
	if ( ! $post ) {
		return 0;
	}
	return count_user_posts( $post->post_author, $post->post_type );
}