检索当前帖子的作者的帖子数量。
原型
get_the_author_posts()
返回值
(int)
作者的帖子数量。
源文件
路径:wp-includes/author-template.php
<?php
...
function get_the_author_posts() {
$post = get_post();
if ( ! $post ) {
return 0;
}
return count_user_posts( $post->post_author, $post->post_type );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/get_the_author_posts/