mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
In get_the_author_posts(), if there is no current $post, return 0 and bail.
Props krogsgard, aaroncampbell. Fixes #27998. git-svn-id: https://develop.svn.wordpress.org/trunk@28362 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -206,7 +206,11 @@ function the_author_link() {
|
||||
* @return int The number of posts by the author.
|
||||
*/
|
||||
function get_the_author_posts() {
|
||||
return count_user_posts( get_post()->post_author );
|
||||
$post = get_post();
|
||||
if ( ! $post ) {
|
||||
return 0;
|
||||
}
|
||||
return count_user_posts( $post->post_author );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user