get_the_author_posts

函数


get_the_author_posts ( No parameters )
返回值
  • (int) The number of posts by the author.
定义位置
  • wp-includes/author-template.php
    , line 283
引入
1.5.0
弃用

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

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