Prevent Notice if the author object is not set.

git-svn-id: https://develop.svn.wordpress.org/trunk@17548 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2011-03-23 21:25:35 +00:00
parent 04aea0e128
commit 3395cc4a62
1 changed files with 2 additions and 0 deletions

View File

@ -203,6 +203,8 @@ function the_author_posts_link($deprecated = '') {
_deprecated_argument( __FUNCTION__, '2.1' );
global $authordata;
if ( !is_object( $authordata ) )
return false;
$link = sprintf(
'<a href="%1$s" title="%2$s">%3$s</a>',
get_author_posts_url( $authordata->ID, $authordata->user_nicename ),