Deprecate idmode. fixes #2386
git-svn-id: http://svn.automattic.com/wordpress/trunk@4146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b8921bfac8
commit
47e7b92b11
|
@ -1,41 +1,15 @@
|
|||
<?php
|
||||
|
||||
function get_the_author($idmode = '') {
|
||||
function get_the_author($deprecated = '') {
|
||||
global $authordata;
|
||||
|
||||
switch ($idmode) {
|
||||
case 'display_name':
|
||||
$id = $authordata->display_name;
|
||||
break;
|
||||
case 'nickname':
|
||||
$id = $authordata->nickname;
|
||||
break;
|
||||
case 'login':
|
||||
$id = $authordata->user_login;
|
||||
break;
|
||||
case 'firstname':
|
||||
$id = $authordata->user_firstname;
|
||||
break;
|
||||
case 'lastname':
|
||||
$id = $authordata->user_lastname;
|
||||
break;
|
||||
case 'namefl':
|
||||
$id = $authordata->user_firstname.' '.$authordata->user_lastname;
|
||||
break;
|
||||
case 'namelf':
|
||||
$id = $authordata->user_lastname.' '.$authordata->user_firstname;
|
||||
break;
|
||||
default:
|
||||
$id = $authordata->display_name;
|
||||
}
|
||||
|
||||
return apply_filters('the_author', $id);
|
||||
return apply_filters('the_author', $authordata->display_name);
|
||||
}
|
||||
|
||||
function the_author($idmode = '', $echo = true) {
|
||||
if ( $echo )
|
||||
echo get_the_author($idmode);
|
||||
return get_the_author($idmode);
|
||||
// Using echo = false is deprecated. Use get_the_author instead.
|
||||
function the_author($deprecated = '', $deprecated_echo = true) {
|
||||
if ( $deprecated_echo )
|
||||
echo get_the_author();
|
||||
return get_the_author();
|
||||
}
|
||||
|
||||
function get_the_author_description() {
|
||||
|
@ -162,10 +136,10 @@ function the_author_posts() {
|
|||
}
|
||||
|
||||
/* the_author_posts_link() requires no get_, use get_author_posts_url() */
|
||||
function the_author_posts_link($idmode='') {
|
||||
function the_author_posts_link($deprecated = '') {
|
||||
global $authordata;
|
||||
|
||||
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>';
|
||||
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>';
|
||||
}
|
||||
|
||||
function get_author_posts_url($author_id, $author_nicename = '') {
|
||||
|
@ -266,4 +240,4 @@ function wp_list_authors($args = '') {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
Loading…
Reference in New Issue