Changes in trunk/wp-includes/author-template.php [6026:7104]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/author-template.php
r6026 r7104 1 1 <?php 2 3 /** 4 * Get the author of the current post in the Loop. 5 * @global object $authordata The current author's DB object. 2 /** 3 * Author Template functions for use in themes. 4 * 5 * @package WordPress 6 * @subpackage Template 7 */ 8 9 /** 10 * get_the_author() - Get the author of the current post in the Loop. 11 * 12 * @since 1.5 13 * @uses $authordata The current author's DB object. 14 * @uses apply_filters() Calls 'the_author' hook on the author display name. 15 * 6 16 * @param string $deprecated Deprecated. 7 17 * @return string The author's display name. … … 13 23 14 24 /** 15 * Echo the name of the author of the current post in the Loop. 25 * the_author() - Echo the name of the author of the current post in the Loop. 26 * 27 * The behavior of this function is based off of old functionality predating get_the_author(). 28 * This function is not deprecated, but is designed to echo the value from get_the_author() 29 * and as an result of any old theme that might still use the old behavior will also 30 * pass the value from get_the_author(). 31 * 32 * The normal, expected behavior of this function is to echo the author and not return it. 33 * However, backwards compatiability has to be maintained. 34 * 35 * @since 0.71 16 36 * @see get_the_author() 37 * 17 38 * @param string $deprecated Deprecated. 18 39 * @param string $deprecated_echo Echo the string or return it. Deprecated, use get_the_author(). … … 26 47 27 48 /** 28 * Get the description of the author of the current post in the Loop. 29 * @global object $authordata The current author's DB object. 49 * get_the_author_description() - Get the description of the author of the current post in the Loop. 50 * 51 * @since 1.5 52 * @uses $authordata The current author's DB object. 30 53 * @return string The author's description. 31 54 */ … … 36 59 37 60 /** 38 * Echo the description of the author of the current post in the Loop. 61 * the_author_description() - Echo the description of the author of the current post in the Loop. 62 * 63 * @since 1.0.0 39 64 * @see get_the_author_description() 40 * @return null41 65 */ 42 66 function the_author_description() { … … 45 69 46 70 /** 47 * Get the login name of the author of the current post in the Loop. 48 * @global object $authordata The current author's DB object. 71 * get_the_author_login() - Get the login name of the author of the current post in the Loop. 72 * 73 * @since 1.5 74 * @uses $authordata The current author's DB object. 49 75 * @return string The author's login name (username). 50 76 */ … … 55 81 56 82 /** 57 * Echo the login name of the author of the current post in the Loop. 83 * the_author_login() - Echo the login name of the author of the current post in the Loop. 84 * 85 * @since 0.71 58 86 * @see get_the_author_login() 59 * @return null60 87 */ 61 88 function the_author_login() { … … 64 91 65 92 /** 66 * Get the first name of the author of the current post in the Loop. 67 * @global object $authordata The current author's DB object. 93 * get_the_author_firstname() - Get the first name of the author of the current post in the Loop. 94 * 95 * @since 1.5 96 * @uses $authordata The current author's DB object. 68 97 * @return string The author's first name. 69 98 */ … … 74 103 75 104 /** 76 * Echo the first name of the author of the current post in the Loop. 77 * @see get_the_author_firstname() 78 * @return null 105 * the_author_firstname() - Echo the first name of the author of the current post in the Loop. 106 * 107 * @since 0.71 108 * @uses get_the_author_firstname() 79 109 */ 80 110 function the_author_firstname() { … … 83 113 84 114 /** 85 * Get the last name of the author of the current post in the Loop. 86 * @global object $authordata The current author's DB object. 115 * get_the_author_lastname() - Get the last name of the author of the current post in the Loop. 116 * 117 * @since 1.5 118 * @uses $authordata The current author's DB object. 87 119 * @return string The author's last name. 88 120 */ … … 93 125 94 126 /** 95 * Echo the last name of the author of the current post in the Loop. 96 * @see get_the_author_lastname() 97 * @return null 127 * the_author_lastname() - Echo the last name of the author of the current post in the Loop. 128 * 129 * @since 0.71 130 * @uses get_the_author_lastname() 98 131 */ 99 132 function the_author_lastname() { … … 102 135 103 136 /** 104 * Get the nickname of the author of the current post in the Loop. 105 * @global object $authordata The current author's DB object. 137 * get_the_author_nickname() - Get the nickname of the author of the current post in the Loop. 138 * 139 * @since 1.5 140 * @uses $authordata The current author's DB object. 106 141 * @return string The author's nickname. 107 142 */ … … 112 147 113 148 /** 114 * Echo the nickname of the author of the current post in the Loop. 115 * @see get_the_author_nickname() 116 * @return null 149 * the_author_nickname() - Echo the nickname of the author of the current post in the Loop. 150 * 151 * @since 0.71 152 * @uses get_the_author_nickname() 117 153 */ 118 154 function the_author_nickname() { … … 121 157 122 158 /** 123 * Get the ID of the author of the current post in the Loop. 124 * @global object $authordata The current author's DB object. 159 * get_the_author_ID() - Get the ID of the author of the current post in the Loop. 160 * 161 * @since 1.5 162 * @uses $authordata The current author's DB object. 125 163 * @return int The author's ID. 126 164 */ … … 131 169 132 170 /** 133 * Echo the ID of the author of the current post in the Loop. 134 * @see get_the_author_ID() 135 * @return null 171 * the_author_ID() - Echo the ID of the author of the current post in the Loop. 172 * 173 * @since 0.71 174 * @uses get_the_author_ID() 136 175 */ 137 176 function the_author_ID() { … … 140 179 141 180 /** 142 * Get the email of the author of the current post in the Loop. 143 * @global object $authordata The current author's DB object. 181 * get_the_author_email() - Get the email of the author of the current post in the Loop. 182 * 183 * @since 1.5 184 * @uses $authordata The current author's DB object. 144 185 * @return string The author's username. 145 186 */ … … 150 191 151 192 /** 152 * Echo the email of the author of the current post in the Loop. 153 * @see get_the_author_email() 154 * @return null 193 * the_author_email() - Echo the email of the author of the current post in the Loop. 194 * 195 * @since 0.71 196 * @uses get_the_author_email() 155 197 */ 156 198 function the_author_email() { … … 159 201 160 202 /** 161 * Get the URL to the home page of the author of the current post in the Loop. 162 * @global object $authordata The current author's DB object. 203 * get_the_author_url() - Get the URL to the home page of the author of the current post in the Loop. 204 * 205 * @since 1.5 206 * @uses $authordata The current author's DB object. 163 207 * @return string The URL to the author's page. 164 208 */ … … 173 217 174 218 /** 175 * Echo the URL to the home page of the author of the current post in the Loop. 176 * @see get_the_author_url() 177 * @return null 219 * the_author_url() - Echo the URL to the home page of the author of the current post in the Loop. 220 * 221 * @since 0.71 222 * @uses get_the_author_url() 178 223 */ 179 224 function the_author_url() { … … 182 227 183 228 /** 184 * If the author has a home page set, echo an HTML link, otherwise just echo the author's name. 185 * @see get_the_author_url() 186 * @see the_author() 187 * @return null 229 * the_author_link() - If the author has a home page set, echo an HTML link, otherwise just echo the author's name. 230 * 231 * @since 2.1 232 * @uses get_the_author_url() 233 * @uses the_author() 188 234 */ 189 235 function the_author_link() { … … 196 242 197 243 /** 198 * Get the ICQ number of the author of the current post in the Loop. 199 * @global object $authordata The current author's DB object. 244 * get_the_author_icq() - Get the ICQ number of the author of the current post in the Loop. 245 * 246 * @since 1.5 247 * @uses $authordata The current author's DB object. 200 248 * @return string The author's ICQ number. 201 249 */ … … 206 254 207 255 /** 208 * Echo the ICQ number of the author of the current post in the Loop. 256 * the_author_icq() - Echo the ICQ number of the author of the current post in the Loop. 257 * 258 * @since 0.71 209 259 * @see get_the_author_icq() 210 * @return null211 260 */ 212 261 function the_author_icq() { … … 215 264 216 265 /** 217 * Get the AIM name of the author of the current post in the Loop. 218 * @global object $authordata The current author's DB object. 266 * get_the_author_aim() - Get the AIM name of the author of the current post in the Loop. 267 * 268 * @since 1.5 269 * @uses $authordata The current author's DB object. 219 270 * @return string The author's AIM name. 220 271 */ … … 225 276 226 277 /** 227 * Echo the AIM name of the author of the current post in the Loop. 278 * the_author_aim() - Echo the AIM name of the author of the current post in the Loop. 279 * 280 * @since 0.71 228 281 * @see get_the_author_aim() 229 * @return null230 282 */ 231 283 function the_author_aim() { … … 234 286 235 287 /** 236 * Get the Yahoo! IM name of the author of the current post in the Loop. 237 * @global object $authordata The current author's DB object. 288 * get_the_author_yim() - Get the Yahoo! IM name of the author of the current post in the Loop. 289 * 290 * @since 1.5 291 * @uses $authordata The current author's DB object. 238 292 * @return string The author's Yahoo! IM name. 239 293 */ … … 244 298 245 299 /** 246 * Echo the Yahoo! IM name of the author of the current post in the Loop. 300 * the_author_yim() - Echo the Yahoo! IM name of the author of the current post in the Loop. 301 * 302 * @since 0.71 247 303 * @see get_the_author_yim() 248 * @return null249 304 */ 250 305 function the_author_yim() { … … 253 308 254 309 /** 255 * Get the MSN address of the author of the current post in the Loop. 256 * @global object $authordata The current author's DB object. 310 * get_the_author_msn() - Get the MSN address of the author of the current post in the Loop. 311 * 312 * @since 1.5 313 * @uses $authordata The current author's DB object. 257 314 * @return string The author's MSN address. 258 315 */ … … 263 320 264 321 /** 265 * Echo the MSN address of the author of the current post in the Loop. 322 * the_author_msn() - Echo the MSN address of the author of the current post in the Loop. 323 * 324 * @since 0.71 266 325 * @see get_the_author_msn() 267 * @return null268 326 */ 269 327 function the_author_msn() { … … 272 330 273 331 /** 274 * Get the number of posts by the author of the current post in the Loop. 275 * @global object $post The current post in the Loop's DB object. 276 * @see get_usernumposts() 332 * get_the_author_posts() - Get the number of posts by the author of the current post in the Loop. 333 * 334 * @since 1.5 335 * @uses $post The current post in the Loop's DB object. 336 * @uses get_usernumposts() 277 337 * @return int The number of posts by the author. 278 338 */ … … 283 343 284 344 /** 285 * Echo the number of posts by the author of the current post in the Loop. 286 * @see get_the_author_posts() 287 * @return null 345 * the_author_posts() - Echo the number of posts by the author of the current post in the Loop. 346 * 347 * @since 0.71 348 * @uses get_the_author_posts() Echos returned value from function. 288 349 */ 289 350 function the_author_posts() { … … 292 353 293 354 /** 294 * Echo an HTML link to the author page of the author of the current post in the Loop. 295 * @global object $authordata The current author's DB object. 296 * @see get_author_posts_url() 297 * @see get_the_author() 298 * @return null 299 */ 300 /* the_author_posts_link() requires no get_, use get_author_posts_url() */ 355 * the_author_posts_link() - Echo an HTML link to the author page of the author of the current post in the Loop. 356 * 357 * Does just echo get_author_posts_url() function, like the others do. The reason for this, 358 * is that another function is used to help in printing the link to the author's posts. 359 * 360 * @since 1.2 361 * @uses $authordata The current author's DB object. 362 * @uses get_author_posts_url() 363 * @uses get_the_author() 364 * @param string $deprecated Deprecated. 365 */ 301 366 function the_author_posts_link($deprecated = '') { 302 367 global $authordata; … … 310 375 311 376 /** 312 * Get the URL to the author page of the author of the current post in the Loop.313 * @global object $wpdb WordPress database layer.314 * @ global object $wp_rewrite WP_Rewrite315 * @ global object $post The current post in the Loop's DB object.377 * get_author_posts_url() - Get the URL to the author page of the author of the current post in the Loop. 378 * 379 * @since 2.1 380 * @uses $wp_rewrite WP_Rewrite 316 381 * @return string The URL to the author's page. 317 382 */ 318 383 function get_author_posts_url($author_id, $author_nicename = '') { 319 global $wp db, $wp_rewrite, $post;384 global $wp_rewrite; 320 385 $auth_ID = (int) $author_id; 321 386 $link = $wp_rewrite->get_author_permastruct(); … … 340 405 341 406 /** 342 * Get the specified author's preferred display name. 407 * get_author_name() - Get the specified author's preferred display name. 408 * 409 * @since 1.0.0 343 410 * @param int $auth_id The ID of the author. 344 411 * @return string The author's display name. … … 350 417 351 418 /** 352 * List all the authors of the blog, with several options available. 419 * wp_list_authors() - List all the authors of the blog, with several options available. 420 * 353 421 * optioncount (boolean) (false): Show the count in parenthesis next to the author's name. 354 422 * exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by default. … … 358 426 * feed_image (string) (''): If isn't empty, use this image to link to feeds. 359 427 * echo (boolean) (true): Set to false to return the output, instead of echoing. 428 * 429 * @since 1.2 360 430 * @param array $args The argument array. 361 431 * @return null|string The output, if echo is set to false. … … 367 437 'optioncount' => false, 'exclude_admin' => true, 368 438 'show_fullname' => false, 'hide_empty' => true, 369 'feed' => '', 'feed_image' => '', ' echo' => true439 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true 370 440 ); 371 441 … … 375 445 $return = ''; 376 446 377 / / TODO: Move select to get_authors().447 /** @todo Move select to get_authors(). */ 378 448 $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name"); 379 449 … … 415 485 416 486 if ( !empty($feed_image) ) 417 $link .= "<img src=\"$feed_image\" border=\"0\"$alt$title" . ' />';487 $link .= "<img src=\"$feed_image\" style=\"border: none;\"$alt$title" . ' />'; 418 488 else 419 489 $link .= $name;
Note: See TracChangeset
for help on using the changeset viewer.