From 1a07e3204eb9403f820048ed729d8eb721411584 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 18 Apr 2004 19:20:37 +0000 Subject: [PATCH] Introduce the_author_posts_link(). git-svn-id: https://develop.svn.wordpress.org/trunk@1095 602fd350-edb4-49c9-b593-d223f7449a82 --- 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;