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:
parent
04aea0e128
commit
3395cc4a62
@ -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 ),
|
||||
|
Loading…
Reference in New Issue
Block a user