From 9abefc0104aee63f487bbb0304789c4ab860f340 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 30 Aug 2006 18:09:12 +0000 Subject: [PATCH] Resurrect idmode. Props MichaelH and westi. fixes #2386 git-svn-id: https://develop.svn.wordpress.org/trunk@4140 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/author-template.php | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php index da24590b2e..017e448c39 100644 --- a/wp-includes/author-template.php +++ b/wp-includes/author-template.php @@ -2,7 +2,34 @@ function get_the_author($idmode = '') { 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) { @@ -239,4 +266,4 @@ function wp_list_authors($args = '') { } } -?> \ No newline at end of file +?>