Changeset 6395
- Timestamp:
- 12/16/2007 11:47:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/author-template.php
r6365 r6395 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 * @since 0.71 16 28 * @see get_the_author() 29 * @deprecated Use get_the_author() 30 * 17 31 * @param string $deprecated Deprecated. 18 32 * @param string $deprecated_echo Echo the string or return it. Deprecated, use get_the_author(). … … 26 40 27 41 /** 28 * Get the description of the author of the current post in the Loop. 29 * @global object $authordata The current author's DB object. 42 * get_the_author_description() - Get the description of the author of the current post in the Loop. 43 * 44 * @since 1.5 45 * @uses $authordata The current author's DB object. 30 46 * @return string The author's description. 31 47 */ … … 36 52 37 53 /** 38 * Echo the description of the author of the current post in the Loop. 54 * the_author_description() - Echo the description of the author of the current post in the Loop. 55 * 56 * @since 1.0.1 39 57 * @see get_the_author_description() 40 * @return null41 58 */ 42 59 function the_author_description() { … … 45 62 46 63 /** 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. 64 * get_the_author_login() - Get the login name of the author of the current post in the Loop. 65 * 66 * @since 1.5 67 * @uses $authordata The current author's DB object. 49 68 * @return string The author's login name (username). 50 69 */ … … 55 74 56 75 /** 57 * Echo the login name of the author of the current post in the Loop. 76 * the_author_login() - Echo the login name of the author of the current post in the Loop. 77 * 78 * @since 0.71 58 79 * @see get_the_author_login() 59 * @return null60 80 */ 61 81 function the_author_login() { … … 64 84 65 85 /** 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. 86 * get_the_author_firstname() - Get the first name of the author of the current post in the Loop. 87 * 88 * @since 1.5 89 * @uses $authordata The current author's DB object. 68 90 * @return string The author's first name. 69 91 */ … … 74 96 75 97 /** 76 * Echo the first name of the author of the current post in the Loop. 77 * @see get_the_author_firstname() 78 * @return null 98 * the_author_firstname() - Echo the first name of the author of the current post in the Loop. 99 * 100 * @since 0.71 101 * @uses get_the_author_firstname() 79 102 */ 80 103 function the_author_firstname() { … … 83 106 84 107 /** 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. 108 * get_the_author_lastname() - Get the last name of the author of the current post in the Loop. 109 * 110 * @since 1.5 111 * @uses $authordata The current author's DB object. 87 112 * @return string The author's last name. 88 113 */ … … 93 118 94 119 /** 95 * Echo the last name of the author of the current post in the Loop. 96 * @see get_the_author_lastname() 97 * @return null 120 * the_author_lastname() - Echo the last name of the author of the current post in the Loop. 121 * 122 * @since 0.71 123 * @uses get_the_author_lastname() 98 124 */ 99 125 function the_author_lastname() { … … 102 128 103 129 /** 104 * Get the nickname of the author of the current post in the Loop. 105 * @global object $authordata The current author's DB object. 130 * get_the_author_nickname() - Get the nickname of the author of the current post in the Loop. 131 * 132 * @since 1.5 133 * @uses $authordata The current author's DB object. 106 134 * @return string The author's nickname. 107 135 */ … … 112 140 113 141 /** 114 * Echo the nickname of the author of the current post in the Loop. 115 * @see get_the_author_nickname() 116 * @return null 142 * the_author_nickname() - Echo the nickname of the author of the current post in the Loop. 143 * 144 * @since 0.71 145 * @uses get_the_author_nickname() 117 146 */ 118 147 function the_author_nickname() { … … 121 150 122 151 /** 123 * Get the ID of the author of the current post in the Loop. 124 * @global object $authordata The current author's DB object. 152 * get_the_author_ID() - Get the ID of the author of the current post in the Loop. 153 * 154 * @since 1.5 155 * @uses $authordata The current author's DB object. 125 156 * @return int The author's ID. 126 157 */ … … 131 162 132 163 /** 133 * Echo the ID of the author of the current post in the Loop. 134 * @see get_the_author_ID() 135 * @return null 164 * the_author_ID() - Echo the ID of the author of the current post in the Loop. 165 * 166 * @since 0.71 167 * @uses get_the_author_ID() 136 168 */ 137 169 function the_author_ID() { … … 140 172 141 173 /** 142 * Get the email of the author of the current post in the Loop. 143 * @global object $authordata The current author's DB object. 174 * get_the_author_email() - Get the email of the author of the current post in the Loop. 175 * 176 * @since 1.5 177 * @uses $authordata The current author's DB object. 144 178 * @return string The author's username. 145 179 */ … … 150 184 151 185 /** 152 * Echo the email of the author of the current post in the Loop. 153 * @see get_the_author_email() 154 * @return null 186 * the_author_email() - Echo the email of the author of the current post in the Loop. 187 * 188 * @since 0.71 189 * @uses get_the_author_email() 155 190 */ 156 191 function the_author_email() { … … 159 194 160 195 /** 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. 196 * get_the_author_url() - Get the URL to the home page of the author of the current post in the Loop. 197 * 198 * @since 1.5 199 * @uses $authordata The current author's DB object. 163 200 * @return string The URL to the author's page. 164 201 */ … … 173 210 174 211 /** 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 212 * the_author_url() - Echo the URL to the home page of the author of the current post in the Loop. 213 * 214 * @since 0.71 215 * @uses get_the_author_url() 178 216 */ 179 217 function the_author_url() { … … 182 220 183 221 /** 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 222 * the_author_link() - If the author has a home page set, echo an HTML link, otherwise just echo the author's name. 223 * 224 * @since 2.1 225 * @uses get_the_author_url() 226 * @uses the_author() 188 227 */ 189 228 function the_author_link() { … … 196 235 197 236 /** 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. 237 * get_the_author_icq() - Get the ICQ number of the author of the current post in the Loop. 238 * 239 * @since 1.5 240 * @uses $authordata The current author's DB object. 200 241 * @return string The author's ICQ number. 201 242 */ … … 206 247 207 248 /** 208 * Echo the ICQ number of the author of the current post in the Loop. 249 * the_author_icq() - Echo the ICQ number of the author of the current post in the Loop. 250 * 251 * @since 0.71 209 252 * @see get_the_author_icq() 210 * @return null211 253 */ 212 254 function the_author_icq() { … … 215 257 216 258 /** 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. 259 * get_the_author_aim() - Get the AIM name of the author of the current post in the Loop. 260 * 261 * @since 1.5 262 * @uses $authordata The current author's DB object. 219 263 * @return string The author's AIM name. 220 264 */ … … 225 269 226 270 /** 227 * Echo the AIM name of the author of the current post in the Loop. 271 * the_author_aim() - Echo the AIM name of the author of the current post in the Loop. 272 * 273 * @since 0.71 228 274 * @see get_the_author_aim() 229 * @return null230 275 */ 231 276 function the_author_aim() { … … 234 279 235 280 /** 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. 281 * get_the_author_yim() - Get the Yahoo! IM name of the author of the current post in the Loop. 282 * 283 * @since 1.5 284 * @uses $authordata The current author's DB object. 238 285 * @return string The author's Yahoo! IM name. 239 286 */ … … 244 291 245 292 /** 246 * Echo the Yahoo! IM name of the author of the current post in the Loop. 293 * the_author_yim() - Echo the Yahoo! IM name of the author of the current post in the Loop. 294 * 295 * @since 0.71 247 296 * @see get_the_author_yim() 248 * @return null249 297 */ 250 298 function the_author_yim() { … … 253 301 254 302 /** 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. 303 * get_the_author_msn() - Get the MSN address of the author of the current post in the Loop. 304 * 305 * @since 1.5 306 * @uses $authordata The current author's DB object. 257 307 * @return string The author's MSN address. 258 308 */ … … 263 313 264 314 /** 265 * Echo the MSN address of the author of the current post in the Loop. 315 * the_author_msn() - Echo the MSN address of the author of the current post in the Loop. 316 * 317 * @since 0.71 266 318 * @see get_the_author_msn() 267 * @return null268 319 */ 269 320 function the_author_msn() { … … 272 323 273 324 /** 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() 325 * get_the_author_posts() - Get the number of posts by the author of the current post in the Loop. 326 * 327 * @since 1.5 328 * @uses $post The current post in the Loop's DB object. 329 * @uses get_usernumposts() 277 330 * @return int The number of posts by the author. 278 331 */ … … 283 336 284 337 /** 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 338 * the_author_posts() - Echo the number of posts by the author of the current post in the Loop. 339 * 340 * @since 0.71 341 * @uses get_the_author_posts() Echos returned value from function. 288 342 */ 289 343 function the_author_posts() { … … 292 346 293 347 /** 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() */ 348 * the_author_posts_link() - Echo an HTML link to the author page of the author of the current post in the Loop. 349 * 350 * Does just echo get_author_posts_url() function, like the others do. The reason for this, 351 * is that another function is used to help in printing the link to the author's posts. 352 * 353 * @since 1.2 354 * @uses $authordata The current author's DB object. 355 * @uses get_author_posts_url() 356 * @uses get_the_author() 357 * @param string $deprecated Deprecated. 358 */ 301 359 function the_author_posts_link($deprecated = '') { 302 360 global $authordata; … … 310 368 311 369 /** 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.370 * get_author_posts_url() - Get the URL to the author page of the author of the current post in the Loop. 371 * 372 * @since 2.1 373 * @uses $wp_rewrite WP_Rewrite 316 374 * @return string The URL to the author's page. 317 375 */ … … 340 398 341 399 /** 342 * Get the specified author's preferred display name. 400 * get_author_name() - Get the specified author's preferred display name. 401 * 402 * @since 1.0.1 343 403 * @param int $auth_id The ID of the author. 344 404 * @return string The author's display name. … … 350 410 351 411 /** 352 * List all the authors of the blog, with several options available. 412 * wp_list_authors() - List all the authors of the blog, with several options available. 413 * 353 414 * optioncount (boolean) (false): Show the count in parenthesis next to the author's name. 354 415 * exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by default. … … 358 419 * feed_image (string) (''): If isn't empty, use this image to link to feeds. 359 420 * echo (boolean) (true): Set to false to return the output, instead of echoing. 421 * 422 * @since 1.2 360 423 * @param array $args The argument array. 361 424 * @return null|string The output, if echo is set to false. … … 375 438 $return = ''; 376 439 377 / / TODO: Move select to get_authors().440 /** @todo Move select to get_authors(). */ 378 441 $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name"); 379 442
Note: See TracChangeset
for help on using the changeset viewer.