| 3 | | function get_the_author($idmode = '') { |
|---|
| 4 | | global $authordata; |
|---|
| 5 | | |
|---|
| 6 | | switch ($idmode) { |
|---|
| 7 | | case 'display_name': |
|---|
| 8 | | $id = $authordata->display_name; |
|---|
| 9 | | break; |
|---|
| 10 | | case 'nickname': |
|---|
| 11 | | $id = $authordata->nickname; |
|---|
| 12 | | break; |
|---|
| 13 | | case 'login': |
|---|
| 14 | | $id = $authordata->user_login; |
|---|
| 15 | | break; |
|---|
| 16 | | case 'firstname': |
|---|
| 17 | | $id = $authordata->user_firstname; |
|---|
| 18 | | break; |
|---|
| 19 | | case 'lastname': |
|---|
| 20 | | $id = $authordata->user_lastname; |
|---|
| 21 | | break; |
|---|
| 22 | | case 'namefl': |
|---|
| 23 | | $id = $authordata->user_firstname.' '.$authordata->user_lastname; |
|---|
| 24 | | break; |
|---|
| 25 | | case 'namelf': |
|---|
| 26 | | $id = $authordata->user_lastname.' '.$authordata->user_firstname; |
|---|
| 27 | | break; |
|---|
| 28 | | default: |
|---|
| 29 | | $id = $authordata->display_name; |
|---|
| 30 | | } |
|---|
| 31 | | |
|---|
| 32 | | return apply_filters('the_author', $id); |
|---|
| 33 | | } |
|---|
| 34 | | |
|---|
| 35 | | function the_author($idmode = '', $echo = true) { |
|---|
| 36 | | if ( $echo ) |
|---|
| 37 | | echo get_the_author($idmode); |
|---|
| 38 | | return get_the_author($idmode); |
|---|
| | 3 | function get_the_author($deprecated = '') { |
|---|
| | 4 | global $authordata; |
|---|
| | 5 | return apply_filters('the_author', $authordata->display_name); |
|---|
| | 6 | } |
|---|
| | 7 | |
|---|
| | 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(); |
|---|