Resurrect idmode. Props MichaelH and westi. fixes #2386
git-svn-id: http://svn.automattic.com/wordpress/trunk@4140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d71d2abfc7
commit
09f48489e1
|
@ -2,7 +2,34 @@
|
||||||
|
|
||||||
function get_the_author($idmode = '') {
|
function get_the_author($idmode = '') {
|
||||||
global $authordata;
|
global $authordata;
|
||||||
return apply_filters('the_author', $authordata->display_name);
|
|
||||||
|
switch ($idmode) {
|
||||||
|
case 'display_name':
|
||||||
|
$id = $authordata->display_name;
|
||||||
|
break;
|
||||||
|
case 'nickname':
|
||||||
|
$id = $authordata->nickname;
|
||||||
|
break;
|
||||||
|
case 'login':
|
||||||
|
$id = $authordata->user_login;
|
||||||
|
break;
|
||||||
|
case 'firstname':
|
||||||
|
$id = $authordata->user_firstname;
|
||||||
|
break;
|
||||||
|
case 'lastname':
|
||||||
|
$id = $authordata->user_lastname;
|
||||||
|
break;
|
||||||
|
case 'namefl':
|
||||||
|
$id = $authordata->user_firstname.' '.$authordata->user_lastname;
|
||||||
|
break;
|
||||||
|
case 'namelf':
|
||||||
|
$id = $authordata->user_lastname.' '.$authordata->user_firstname;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$id = $authordata->display_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return apply_filters('the_author', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function the_author($idmode = '', $echo = true) {
|
function the_author($idmode = '', $echo = true) {
|
||||||
|
|
Loading…
Reference in New Issue