Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/author-template.php

    r6026 r7104  
    11<?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 *
    616 * @param string $deprecated Deprecated.
    717 * @return string The author's display name.
     
    1323
    1424/**
    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
    1636 * @see get_the_author()
     37 *
    1738 * @param string $deprecated Deprecated.
    1839 * @param string $deprecated_echo Echo the string or return it. Deprecated, use get_the_author().
     
    2647
    2748/**
    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.
    3053 * @return string The author's description.
    3154 */
     
    3659
    3760/**
    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
    3964 * @see get_the_author_description()
    40  * @return null
    4165 */
    4266function the_author_description() {
     
    4569
    4670/**
    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.
    4975 * @return string The author's login name (username).
    5076 */
     
    5581
    5682/**
    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
    5886 * @see get_the_author_login()
    59  * @return null
    6087 */
    6188function the_author_login() {
     
    6491
    6592/**
    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.
    6897 * @return string The author's first name.
    6998 */
     
    74103
    75104/**
    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()
    79109 */
    80110function the_author_firstname() {
     
    83113
    84114/**
    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.
    87119 * @return string The author's last name.
    88120 */
     
    93125
    94126/**
    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()
    98131 */
    99132function the_author_lastname() {
     
    102135
    103136/**
    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.
    106141 * @return string The author's nickname.
    107142 */
     
    112147
    113148/**
    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()
    117153 */
    118154function the_author_nickname() {
     
    121157
    122158/**
    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.
    125163 * @return int The author's ID.
    126164 */
     
    131169
    132170/**
    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()
    136175 */
    137176function the_author_ID() {
     
    140179
    141180/**
    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.
    144185 * @return string The author's username.
    145186 */
     
    150191
    151192/**
    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()
    155197 */
    156198function the_author_email() {
     
    159201
    160202/**
    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.
    163207 * @return string The URL to the author's page.
    164208 */
     
    173217
    174218/**
    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()
    178223 */
    179224function the_author_url() {
     
    182227
    183228/**
    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()
    188234 */
    189235function the_author_link() {
     
    196242
    197243/**
    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.
    200248 * @return string The author's ICQ number.
    201249 */
     
    206254
    207255/**
    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
    209259 * @see get_the_author_icq()
    210  * @return null
    211260 */
    212261function the_author_icq() {
     
    215264
    216265/**
    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.
    219270 * @return string The author's AIM name.
    220271 */
     
    225276
    226277/**
    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
    228281 * @see get_the_author_aim()
    229  * @return null
    230282 */
    231283function the_author_aim() {
     
    234286
    235287/**
    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.
    238292 * @return string The author's Yahoo! IM name.
    239293 */
     
    244298
    245299/**
    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
    247303 * @see get_the_author_yim()
    248  * @return null
    249304 */
    250305function the_author_yim() {
     
    253308
    254309/**
    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.
    257314 * @return string The author's MSN address.
    258315 */
     
    263320
    264321/**
    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
    266325 * @see get_the_author_msn()
    267  * @return null
    268326 */
    269327function the_author_msn() {
     
    272330
    273331/**
    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()
    277337 * @return int The number of posts by the author.
    278338 */
     
    283343
    284344/**
    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.
    288349 */
    289350function the_author_posts() {
     
    292353
    293354/**
    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 */
    301366function the_author_posts_link($deprecated = '') {
    302367    global $authordata;
     
    310375
    311376/**
    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_Rewrite
    315  * @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
    316381 * @return string The URL to the author's page.
    317382 */
    318383function get_author_posts_url($author_id, $author_nicename = '') {
    319     global $wpdb, $wp_rewrite, $post;
     384    global $wp_rewrite;
    320385    $auth_ID = (int) $author_id;
    321386    $link = $wp_rewrite->get_author_permastruct();
     
    340405
    341406/**
    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
    343410 * @param int $auth_id The ID of the author.
    344411 * @return string The author's display name.
     
    350417
    351418/**
    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 *
    353421 * optioncount (boolean) (false): Show the count in parenthesis next to the author's name.
    354422 * exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by default.
     
    358426 * feed_image (string) (''): If isn't empty, use this image to link to feeds.
    359427 * echo (boolean) (true): Set to false to return the output, instead of echoing.
     428 *
     429 * @since 1.2
    360430 * @param array $args The argument array.
    361431 * @return null|string The output, if echo is set to false.
     
    367437        'optioncount' => false, 'exclude_admin' => true,
    368438        'show_fullname' => false, 'hide_empty' => true,
    369         'feed' => '', 'feed_image' => '', 'echo' => true
     439        'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true
    370440    );
    371441
     
    375445    $return = '';
    376446
    377     // TODO:  Move select to get_authors().
     447    /** @todo Move select to get_authors(). */
    378448    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name");
    379449
     
    415485
    416486                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" . ' />';
    418488                else
    419489                    $link .= $name;
Note: See TracChangeset for help on using the changeset viewer.