Use get_userdata(). fixes #2976
git-svn-id: https://develop.svn.wordpress.org/trunk@4055 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
852bc46505
commit
ae80425b1e
@ -142,8 +142,11 @@ function get_author_link($echo = false, $author_id, $author_nicename) {
|
|||||||
$file = get_settings('home') . '/';
|
$file = get_settings('home') . '/';
|
||||||
$link = $file . '?author=' . $auth_ID;
|
$link = $file . '?author=' . $auth_ID;
|
||||||
} else {
|
} else {
|
||||||
if ( '' == $author_nicename )
|
if ( '' == $author_nicename ) {
|
||||||
$author_nicename = $cache_userdata[$author_id]->user_nicename;
|
$user = get_userdata($author_id);
|
||||||
|
if ( !empty($user->user_nicename) )
|
||||||
|
$author_nicename = $user->user_nicename;
|
||||||
|
}
|
||||||
$link = str_replace('%author%', $author_nicename, $link);
|
$link = str_replace('%author%', $author_nicename, $link);
|
||||||
$link = get_settings('home') . trailingslashit($link);
|
$link = get_settings('home') . trailingslashit($link);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user