Prevent Notice if the author object is not set.

git-svn-id: http://svn.automattic.com/wordpress/trunk@17548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2011-03-23 21:25:35 +00:00
parent c1da7bbb0b
commit 1cc45202e6

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 ),