From 4e2b38a98190b819ce1f8e12c8d05377906f565b Mon Sep 17 00:00:00 2001 From: rboren Date: Sun, 18 Apr 2004 19:20:37 +0000 Subject: [PATCH] Introduce the_author_posts_link(). git-svn-id: http://svn.automattic.com/wordpress/trunk@1095 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-author.php | 32 ++++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/wp-includes/template-functions-author.php b/wp-includes/template-functions-author.php index c26d23d465..86993bbee6 100644 --- a/wp-includes/template-functions-author.php +++ b/wp-includes/template-functions-author.php @@ -1,15 +1,20 @@ user_idmode; - if ($i == 'nickname') echo $authordata->user_nickname; - if ($i == 'login') echo $authordata->user_login; - if ($i == 'firstname') echo $authordata->user_firstname; - if ($i == 'lastname') echo $authordata->user_lastname; - if ($i == 'namefl') echo $authordata->user_firstname.' '.$authordata->user_lastname; - if ($i == 'namelf') echo $authordata->user_lastname.' '.$authordata->user_firstname; - if (!$i) echo $authordata->user_nickname; +function the_author($idmode = '', $echo = true) { + global $authordata; + if (empty($idmode)) { + $idmode = $authordata->user_idmode; + } + if ($idmode == 'nickname') $id = $authordata->user_nickname; + if ($idmode == 'login') $id = $authordata->user_login; + if ($idmode == 'firstname') $id = $authordata->user_firstname; + if ($idmode == 'lastname') $id = $authordata->user_lastname; + if ($idmode == 'namefl') $id = $authordata->user_firstname.' '.$authordata->user_lastname; + if ($idmode == 'namelf') $id = $authordata->user_lastname.' '.$authordata->user_firstname; + if (!$idmode) $id = $authordata->user_nickname; + + if ($echo) echo $id; + return $id; } function the_author_description() { global $authordata; @@ -63,6 +68,13 @@ function the_author_posts() { global $id,$post; $posts=get_usernumposts($post->post_author); echo $posts; } +function the_author_posts_link($idmode='') { + global $id, $authordata; + + echo '' . stripslashes(the_author($idmode, false)) . ''; +} + + function get_author_link($echo = false, $author_id, $author_nicename) { global $wpdb, $tableusers, $post, $querystring_start, $querystring_equal, $cache_authors; $auth_ID = $author_id;