3 function get_the_author($deprecated = '') {
5 return apply_filters('the_author', $authordata->display_name);
8 // Using echo = false is deprecated. Use get_the_author instead.
9 function the_author($deprecated = '', $deprecated_echo = true) {
10 if ( $deprecated_echo )
11 echo get_the_author();
12 return get_the_author();
15 function get_the_author_description() {
17 return $authordata->description;
19 function the_author_description() {
20 echo get_the_author_description();
23 function get_the_author_login() {
25 return $authordata->user_login;
28 function the_author_login() {
29 echo get_the_author_login();
32 function get_the_author_firstname() {
34 return $authordata->first_name;
36 function the_author_firstname() {
37 echo get_the_author_firstname();
40 function get_the_author_lastname() {
42 return $authordata->last_name;
45 function the_author_lastname() {
46 echo get_the_author_lastname();
49 function get_the_author_nickname() {
51 return $authordata->nickname;
54 function the_author_nickname() {
55 echo get_the_author_nickname();
58 function get_the_author_ID() {
60 return $authordata->ID;
62 function the_author_ID() {
63 echo get_the_author_id();
66 function get_the_author_email() {
68 return $authordata->user_email;
71 function the_author_email() {
72 echo apply_filters('the_author_email', get_the_author_email() );
75 function get_the_author_url() {
77 return $authordata->user_url;
80 function the_author_url() {
81 echo get_the_author_url();
84 function get_the_author_icq() {
86 return $authordata->icq;
89 function the_author_icq() {
90 echo get_the_author_icq();
93 function get_the_author_aim() {
95 return str_replace(' ', '+', $authordata->aim);
98 function the_author_aim() {
99 echo get_the_author_aim();
102 function get_the_author_yim() {
104 return $authordata->yim;
107 function the_author_yim() {
108 echo get_the_author_yim();
111 function get_the_author_msn() {
113 return $authordata->msn;
116 function the_author_msn() {
117 echo get_the_author_msn();
120 function get_the_author_posts() {
122 $posts = get_usernumposts($post->post_author);
126 function the_author_posts() {
127 echo get_the_author_posts();
130 /* the_author_posts_link() requires no get_, use get_author_link() */
131 function the_author_posts_link($deprecated = '') {
134 echo '<a href="' . get_author_link(0, $authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), attribute_escape(get_the_author())) . '">' . get_the_author() . '</a>';
137 function get_author_link($echo = false, $author_id, $author_nicename = '') {
138 global $wpdb, $wp_rewrite, $post, $cache_userdata;
139 $auth_ID = (int) $author_id;
140 $link = $wp_rewrite->get_author_permastruct();
142 if ( empty($link) ) {
143 $file = get_settings('home') . '/';
144 $link = $file . '?author=' . $auth_ID;
146 if ( '' == $author_nicename ) {
147 $user = get_userdata($author_id);
148 if ( !empty($user->user_nicename) )
149 $author_nicename = $user->user_nicename;
151 $link = str_replace('%author%', $author_nicename, $link);
152 $link = get_settings('home') . trailingslashit($link);
155 $link = apply_filters('author_link', $link, $author_id, $author_nicename);
162 function wp_list_authors($args = '') {
163 parse_str($args, $r);
165 if ( !isset($r['optioncount']) )
166 $r['optioncount'] = false;
167 if ( !isset($r['exclude_admin']) )
168 $r['exclude_admin'] = true;
169 if ( !isset($r['show_fullname']) )
170 $r['show_fullname'] = false;
171 if ( !isset($r['hide_empty']) )
172 $r['hide_empty'] = true;
173 if ( !isset($r['feed']) )
175 if ( !isset($r['feed_image']) )
176 $r['feed_image'] = '';
178 list_authors($r['optioncount'], $r['exclude_admin'], $r['show_fullname'], $r['hide_empty'], $r['feed'], $r['feed_image']);
181 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
183 $query = "SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name";
184 $authors = $wpdb->get_results($query);
186 foreach ( (array) $authors as $author ) {
187 $author = get_userdata( $author->ID );
188 $posts = get_usernumposts($author->ID);
189 $name = $author->nickname;
191 if ( $show_fullname && ($author->first_name != '' && $author->last_name != '') )
192 $name = "$author->first_name $author->last_name";
194 if ( !($posts == 0 && $hide_empty) )
200 $link = '<a href="' . get_author_link(0, $author->ID, $author->user_nicename) . '" title="' . sprintf(__("Posts by %s"), attribute_escape($author->display_name)) . '">' . $name . '</a>';
202 if ( (! empty($feed_image)) || (! empty($feed)) ) {
204 if (empty($feed_image))
206 $link .= '<a href="' . get_author_rss_link(0, $author->ID, $author->user_nicename) . '"';
208 if ( !empty($feed) ) {
209 $title = ' title="' . $feed . '"';
210 $alt = ' alt="' . $feed . '"';
217 if ( !empty($feed_image) )
218 $link .= "<img src=\"$feed_image\" border=\"0\"$alt$title" . ' />';
224 if ( empty($feed_image) )
229 $link .= ' ('. $posts . ')';
233 if ( !($posts == 0 && $hide_empty) )