get_the_author_posts

Advertisement

Summery Summery

Image for: #Summery Summery

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

Syntax Syntax

Image for: #Syntax Syntax
get_the_author_posts()

Return Return

Image for: #Return Return

(int) The number of posts by the author.

Source Source

Image for: #Source Source

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 );
}

Advertisement

Changelog Changelog

Image for: #Changelog Changelog
Changelog
VersionDescription
1.5.0Introduced.
Image for: #Related Related

Advertisement

Leave a Reply