Changeset 4146
- Timestamp:
- 08/31/2006 05:07:12 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/author-template.php
r4144 r4146 1 1 <?php 2 2 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(); 39 13 } 40 14 … … 163 137 164 138 /* the_author_posts_link() requires no get_, use get_author_posts_url() */ 165 function the_author_posts_link($ idmode='') {166 global $authordata; 167 168 echo '<a href="' . get_author_posts_url($authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars( the_author($idmode, false))) . '">' . the_author($idmode, false) . '</a>';139 function the_author_posts_link($deprecated = '') { 140 global $authordata; 141 142 echo '<a href="' . get_author_posts_url($authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars(get_the_author())) . '">' . get_the_author() . '</a>'; 169 143 } 170 144
Note: See TracChangeset
for help on using the changeset viewer.