WordPress.org

Make WordPress Core

Ticket #8776: 8776-working-tested-patch.diff

File 8776-working-tested-patch.diff, 15.0 KB (added by thee17, 9 years ago)

fixed a missig bracket in depreciated and inline doc in author_template

  • author-template.php

     
    5151}
    5252
    5353/**
    54  * Retrieve the description of the author of the current post.
     54 * Retrieve the requested data of the author of the current post.
    5555 *
    56  * @since 1.5
     56 * @link http://codex.wordpress.org/Template_Tags/the_author_meta
     57 * @since 2.8.0
    5758 * @uses $authordata The current author's DB object.
    58  * @return string The author's description.
     59 * @param string $field selects the field of the users record.
     60 * @echo string The author's field from the current author's DB object.
    5961 */
    60 function get_the_author_description() {
     62function the_author_meta($field = '') {
    6163        global $authordata;
    62         return $authordata->description;
     64        echo isset($authordata->$field) ? $authordata->$field : '';
    6365}
    6466
    65 /**
    66  * Display the description of the author of the current post.
    67  *
    68  * @link http://codex.wordpress.org/Template_Tags/the_author_description
    69  * @since 1.0.0
    70  * @see get_the_author_description()
    71  */
    72 function the_author_description() {
    73         echo get_the_author_description();
    74 }
     67/**
     68 * Retrieve the ID of the author of the current post.
     69 *
     70 * @since 1.5
     71 * @uses $authordata The current author's DB object.
     72 * @return int The author's ID.
     73 */
     74function get_the_author_ID() {
     75        global $authordata;
     76        return (int) $authordata->ID;
     77}
     78 
     79/**
     80 * Display the ID of the author of the current post.
     81 *
     82 * @link http://codex.wordpress.org/Template_Tags/the_author_ID
     83 * @since 0.71
     84 * @uses get_the_author_ID()
     85 */
     86function the_author_ID() {
     87        echo get_the_author_id();
     88}
    7589
    7690/**
    77  * Retrieve the login name of the author of the current post.
    78  *
    79  * @since 1.5
    80  * @uses $authordata The current author's DB object.
    81  * @return string The author's login name (username).
    82  */
    83 function get_the_author_login() {
    84         global $authordata;
    85         return $authordata->user_login;
    86 }
    87 
    88 /**
    89  * Display the login name of the author of the current post.
    90  *
    91  * @link http://codex.wordpress.org/Template_Tags/the_author_login
    92  * @since 0.71
    93  * @see get_the_author_login()
    94  */
    95 function the_author_login() {
    96         echo get_the_author_login();
    97 }
    98 
    99 /**
    100  * Retrieve the first name of the author of the current post.
    101  *
    102  * @since 1.5
    103  * @uses $authordata The current author's DB object.
    104  * @return string The author's first name.
    105  */
    106 function get_the_author_firstname() {
    107         global $authordata;
    108         return $authordata->first_name;
    109 }
    110 
    111 /**
    112  * Display the first name of the author of the current post.
    113  *
    114  * @link http://codex.wordpress.org/Template_Tags/the_author_firstname
    115  * @since 0.71
    116  * @uses get_the_author_firstname()
    117  */
    118 function the_author_firstname() {
    119         echo get_the_author_firstname();
    120 }
    121 
    122 /**
    123  * Retrieve the last name of the author of the current post.
    124  *
    125  * @since 1.5
    126  * @uses $authordata The current author's DB object.
    127  * @return string The author's last name.
    128  */
    129 function get_the_author_lastname() {
    130         global $authordata;
    131         return $authordata->last_name;
    132 }
    133 
    134 /**
    135  * Display the last name of the author of the current post.
    136  *
    137  * @link http://codex.wordpress.org/Template_Tags/the_author_lastname
    138  * @since 0.71
    139  * @uses get_the_author_lastname()
    140  */
    141 function the_author_lastname() {
    142         echo get_the_author_lastname();
    143 }
    144 
    145 /**
    146  * Retrieve the nickname of the author of the current post.
    147  *
    148  * @since 1.5
    149  * @uses $authordata The current author's DB object.
    150  * @return string The author's nickname.
    151  */
    152 function get_the_author_nickname() {
    153         global $authordata;
    154         return $authordata->nickname;
    155 }
    156 
    157 /**
    158  * Display the nickname of the author of the current post.
    159  *
    160  * @link http://codex.wordpress.org/Template_Tags/the_author_nickname
    161  * @since 0.71
    162  * @uses get_the_author_nickname()
    163  */
    164 function the_author_nickname() {
    165         echo get_the_author_nickname();
    166 }
    167 
    168 /**
    169  * Retrieve the ID of the author of the current post.
    170  *
    171  * @since 1.5
    172  * @uses $authordata The current author's DB object.
    173  * @return int The author's ID.
    174  */
    175 function get_the_author_ID() {
    176         global $authordata;
    177         return (int) $authordata->ID;
    178 }
    179 
    180 /**
    181  * Display the ID of the author of the current post.
    182  *
    183  * @link http://codex.wordpress.org/Template_Tags/the_author_ID
    184  * @since 0.71
    185  * @uses get_the_author_ID()
    186  */
    187 function the_author_ID() {
    188         echo get_the_author_id();
    189 }
    190 
    191 /**
    192  * Retrieve the email of the author of the current post.
    193  *
    194  * @since 1.5
    195  * @uses $authordata The current author's DB object.
    196  * @return string The author's username.
    197  */
    198 function get_the_author_email() {
    199         global $authordata;
    200         return $authordata->user_email;
    201 }
    202 
    203 /**
    204  * Display the email of the author of the current post.
    205  *
    206  * @link http://codex.wordpress.org/Template_Tags/the_author_email
    207  * @since 0.71
    208  * @uses get_the_author_email()
    209  */
    210 function the_author_email() {
    211         echo apply_filters('the_author_email', get_the_author_email() );
    212 }
    213 
    214 /**
    21591 * Retrieve the URL to the home page of the author of the current post.
    21692 *
    21793 * @since 1.5
     
    258134}
    259135
    260136/**
    261  * Retrieve the ICQ number of the author of the current post.
    262  *
    263  * @since 1.5
    264  * @uses $authordata The current author's DB object.
    265  * @return string The author's ICQ number.
    266  */
    267 function get_the_author_icq() {
    268         global $authordata;
    269         return $authordata->icq;
    270 }
    271 
    272 /**
    273  * Display the ICQ number of the author of the current post.
    274  *
    275  * @link http://codex.wordpress.org/Template_Tags/the_author_icq
    276  * @since 0.71
    277  * @see get_the_author_icq()
    278  */
    279 function the_author_icq() {
    280         echo get_the_author_icq();
    281 }
    282 
    283 /**
    284137 * Retrieve the AIM name of the author of the current post.
    285138 *
    286139 * @since 1.5
     
    304157}
    305158
    306159/**
    307  * Retrieve the Yahoo! IM name of the author of the current post.
    308  *
    309  * @since 1.5
    310  * @uses $authordata The current author's DB object.
    311  * @return string The author's Yahoo! IM name.
    312  */
    313 function get_the_author_yim() {
    314         global $authordata;
    315         return $authordata->yim;
    316 }
    317 
    318 /**
    319  * Display the Yahoo! IM name of the author of the current post.
    320  *
    321  * @link http://codex.wordpress.org/Template_Tags/the_author_yim
    322  * @since 0.71
    323  * @see get_the_author_yim()
    324  */
    325 function the_author_yim() {
    326         echo get_the_author_yim();
    327 }
    328 
    329 /**
    330  * Retrieve the MSN address of the author of the current post.
    331  *
    332  * @since 1.5
    333  * @uses $authordata The current author's DB object.
    334  * @return string The author's MSN address.
    335  */
    336 function get_the_author_msn() {
    337         global $authordata;
    338         return $authordata->msn;
    339 }
    340 
    341 /**
    342  * Display the MSN address of the author of the current post.
    343  *
    344  * @link http://codex.wordpress.org/Template_Tags/the_author_msn
    345  * @since 0.71
    346  * @see get_the_author_msn()
    347  */
    348 function the_author_msn() {
    349         echo get_the_author_msn();
    350 }
    351 
    352 /**
    353160 * Retrieve the number of posts by the author of the current post.
    354161 *
    355162 * @since 1.5
     
    428235}
    429236
    430237/**
    431  * Retrieve the specified author's preferred display name.
    432  *
    433  * @since 1.0.0
    434  * @param int $auth_id The ID of the author.
    435  * @return string The author's display name.
    436  */
    437 function get_author_name( $auth_id ) {
    438         $authordata = get_userdata( $auth_id );
    439         return $authordata->display_name;
    440 }
    441 
    442 /**
    443238 * List all the authors of the blog, with several options available.
    444239 *
    445240 * optioncount (boolean) (false): Show the count in parenthesis next to the
     
    534329        echo $return;
    535330}
    536331
    537 ?>
     332?>
     333 No newline at end of file
  • deprecated.php

     
    13041304        return get_comment($comment_ID, ARRAY_A);
    13051305}
    13061306
     1307/**
     1308 * Retrieve the description of the author of the current post.
     1309 *
     1310 * @since 1.5
     1311 * @uses $authordata The current author's DB object.
     1312 * @return string The author's description.
     1313 * @deprecated 2.8
     1314 * @deprecated Use the_author_meta('description')
     1315 */
     1316function get_the_author_description() {
     1317        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'description\')' );
     1318        echo the_author_meta('description');
     1319}
     1320
     1321/**
     1322 * Display the description of the author of the current post.
     1323 *
     1324 * @link http://codex.wordpress.org/Template_Tags/the_author_description
     1325 * @since 1.0.0
     1326 * @deprecated 2.8
     1327 * @deprecated Use the_author_meta('description')
     1328 */
     1329function the_author_description() {
     1330        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'description\')' );
     1331        echo the_author_meta('description');
     1332}
     1333
     1334/**
     1335 * Retrieve the login name of the author of the current post.
     1336 *
     1337 * @since 1.5
     1338 * @uses $authordata The current author's DB object.
     1339 * @return string The author's login name (username).
     1340 * @deprecated 2.8
     1341 * @deprecated Use the_author_meta('user_login')
     1342 */
     1343function get_the_author_login() {
     1344        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'user_login\')' );
     1345        echo the_author_meta('user_login');
     1346}
     1347
     1348/**
     1349 * Display the login name of the author of the current post.
     1350 *
     1351 * @link http://codex.wordpress.org/Template_Tags/the_author_login
     1352 * @since 0.71
     1353 * @deprecated 2.8
     1354 * @deprecated Use the_author_meta('user_login')
     1355 */
     1356function the_author_login() {
     1357        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'user_login\')' );
     1358        echo the_author_meta('user_login');
     1359}
     1360
     1361/**
     1362 * Retrieve the first name of the author of the current post.
     1363 *
     1364 * @since 1.5
     1365 * @uses $authordata The current author's DB object.
     1366 * @return string The author's first name.
     1367 * @deprecated 2.8
     1368 * @deprecated Use the_author_meta('first_name')
     1369 */
     1370function get_the_author_firstname() {
     1371        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' );
     1372        echo the_author_meta('first_name');
     1373}
     1374
     1375/**
     1376 * Display the first name of the author of the current post.
     1377 *
     1378 * @link http://codex.wordpress.org/Template_Tags/the_author_firstname
     1379 * @since 0.71
     1380 * @deprecated 2.8
     1381 * @deprecated Use the_author_meta('first_name')
     1382 */
     1383function the_author_firstname() {
     1384        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' );
     1385        echo the_author_meta('first_name');
     1386}
     1387
     1388/**
     1389 * Retrieve the last name of the author of the current post.
     1390 *
     1391 * @since 1.5
     1392 * @uses $authordata The current author's DB object.
     1393 * @return string The author's last name.
     1394 * @deprecated 2.8
     1395 * @deprecated Use the_author_meta('last_name')
     1396 */
     1397function get_the_author_lastname() {
     1398        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' );
     1399        echo the_author_meta('last_name');
     1400}
     1401
     1402/**
     1403 * Display the last name of the author of the current post.
     1404 *
     1405 * @link http://codex.wordpress.org/Template_Tags/the_author_lastname
     1406 * @since 0.71
     1407 * @deprecated 2.8
     1408 * @deprecated Use the_author_meta('last_name')
     1409 */
     1410function the_author_lastname() {
     1411        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' );
     1412        echo the_author_meta('last_name');
     1413}
     1414
     1415/**
     1416 * Retrieve the nickname of the author of the current post.
     1417 *
     1418 * @since 1.5
     1419 * @uses $authordata The current author's DB object.
     1420 * @return string The author's nickname.
     1421 * @deprecated 2.8
     1422 * @deprecated Use the_author_meta('nickname')
     1423 */
     1424function get_the_author_nickname() {
     1425        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' );
     1426        echo the_author_meta('nickname');
     1427}
     1428
     1429/**
     1430 * Display the nickname of the author of the current post.
     1431 *
     1432 * @link http://codex.wordpress.org/Template_Tags/the_author_nickname
     1433 * @since 0.71
     1434 * @deprecated 2.8
     1435 * @deprecated Use the_author_meta('nickname')
     1436 */
     1437function the_author_nickname() {
     1438        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' );
     1439        echo the_author_meta('nickname');
     1440}
     1441
     1442/**
     1443 * Retrieve the email of the author of the current post.
     1444 *
     1445 * @since 1.5
     1446 * @uses $authordata The current author's DB object.
     1447 * @return string The author's username.
     1448 * @deprecated 2.8
     1449 * @deprecated Use the_author_meta('user_email')
     1450 */
     1451function get_the_author_email() {
     1452        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'user_email\')' );
     1453        echo the_author_meta('user_email');
     1454}
     1455
     1456/**
     1457 * Display the email of the author of the current post.
     1458 *
     1459 * @link http://codex.wordpress.org/Template_Tags/the_author_email
     1460 * @since 0.71
     1461 * @deprecated 2.8
     1462 * @deprecated Use the_author_meta('user_email')
     1463 */
     1464function the_author_email() {
     1465        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'user_email\')' );
     1466        echo the_author_meta('user_email');
     1467}
     1468
     1469/**
     1470 * Retrieve the ICQ number of the author of the current post.
     1471 *
     1472 * @since 1.5
     1473 * @uses $authordata The current author's DB object.
     1474 * @return string The author's ICQ number.
     1475 * @deprecated 2.8
     1476 * @deprecated Use the_author_meta('icq')
     1477 */
     1478function get_the_author_icq() {
     1479        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'icq\')' );
     1480        echo the_author_meta('icq');
     1481}
     1482
     1483/**
     1484 * Display the ICQ number of the author of the current post.
     1485 *
     1486 * @link http://codex.wordpress.org/Template_Tags/the_author_icq
     1487 * @since 0.71
     1488 * @see get_the_author_icq()
     1489 * @deprecated 2.8
     1490 * @deprecated Use the_author_meta('icq')
     1491 */
     1492function the_author_icq() {
     1493        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'icq\')' );
     1494        echo the_author_meta('icq');
     1495}
     1496
     1497/**
     1498 * Retrieve the Yahoo! IM name of the author of the current post.
     1499 *
     1500 * @since 1.5
     1501 * @uses $authordata The current author's DB object.
     1502 * @return string The author's Yahoo! IM name.
     1503 * @deprecated 2.8
     1504 * @deprecated Use the_author_meta('yim')
     1505 */
     1506function get_the_author_yim() {
     1507        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'yim\')' );
     1508        echo the_author_meta('yim');
     1509}
     1510
     1511/**
     1512 * Display the Yahoo! IM name of the author of the current post.
     1513 *
     1514 * @link http://codex.wordpress.org/Template_Tags/the_author_yim
     1515 * @since 0.71
     1516 * @deprecated 2.8
     1517 * @deprecated Use the_author_meta('yim')
     1518 */
     1519function the_author_yim() {
     1520        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'yim\')' );
     1521        echo the_author_meta('yim');
     1522}
     1523
     1524/**
     1525 * Retrieve the MSN address of the author of the current post.
     1526 *
     1527 * @since 1.5
     1528 * @uses $authordata The current author's DB object.
     1529 * @return string The author's MSN address.
     1530 * @deprecated 2.8
     1531 * @deprecated Use the_author_meta('msn')
     1532 */
     1533function get_the_author_msn() {
     1534        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'msn\')' );
     1535        echo the_author_meta('msn');
     1536}
     1537
     1538/**
     1539 * Display the MSN address of the author of the current post.
     1540 *
     1541 * @link http://codex.wordpress.org/Template_Tags/the_author_msn
     1542 * @since 0.71
     1543 * @see get_the_author_msn()
     1544 * @deprecated 2.8
     1545 * @deprecated Use the_author_meta('msn')
     1546 */
     1547function the_author_msn() {
     1548        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'msn\')' );
     1549        echo the_author_meta('msn');
     1550}
     1551
     1552/**
     1553 * Retrieve the specified author's preferred display name.
     1554 *
     1555 * @since 1.0.0
     1556 * @param int $auth_id The ID of the author.
     1557 * @return string The author's display name.
     1558 * @deprecated 2.8
     1559 * @deprecated Use the_author_meta('display_name')
     1560 */
     1561function get_author_name( $auth_id ) {
     1562        _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'display_name\')' );
     1563        echo the_author_meta('display_name');
     1564}
     1565
    13071566?>
     1567 No newline at end of file