Use get_userdata(). fixes #2976

git-svn-id: http://svn.automattic.com/wordpress/trunk@4055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-07-27 23:27:27 +00:00
parent 45cacb257a
commit 2dd0ce000f

View File

@ -142,8 +142,11 @@ function get_author_link($echo = false, $author_id, $author_nicename) {
$file = get_settings('home') . '/';
$link = $file . '?author=' . $auth_ID;
} else {
if ( '' == $author_nicename )
$author_nicename = $cache_userdata[$author_id]->user_nicename;
if ( '' == $author_nicename ) {
$user = get_userdata($author_id);
if ( !empty($user->user_nicename) )
$author_nicename = $user->user_nicename;
}
$link = str_replace('%author%', $author_nicename, $link);
$link = get_settings('home') . trailingslashit($link);
}