Deprecate list_authors(). Clean up wp_list_authors().

git-svn-id: http://svn.automattic.com/wordpress/trunk@3848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-06-06 04:50:41 +00:00
parent 73b4b6055e
commit db3a022631
2 changed files with 15 additions and 17 deletions

View File

@ -456,4 +456,10 @@ function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = '
function tinymce_include() {
wp_print_script( 'wp_tiny_mce' );
}
function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
$args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image');
return wp_list_authors($args);
}
?>

View File

@ -156,26 +156,18 @@ function get_author_link($echo = false, $author_id, $author_nicename) {
}
function wp_list_authors($args = '') {
if ( is_array($args) )
$r = &$args;
else
parse_str($args, $r);
if ( !isset($r['optioncount']) )
$r['optioncount'] = false;
if ( !isset($r['exclude_admin']) )
$r['exclude_admin'] = true;
if ( !isset($r['show_fullname']) )
$r['show_fullname'] = false;
if ( !isset($r['hide_empty']) )
$r['hide_empty'] = true;
if ( !isset($r['feed']) )
$r['feed'] = '';
if ( !isset($r['feed_image']) )
$r['feed_image'] = '';
$defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true,
'feed' => '', 'feed_image' => '');
$r = array_merge($defaults, $r);
extract($r);
list_authors($r['optioncount'], $r['exclude_admin'], $r['show_fullname'], $r['hide_empty'], $r['feed'], $r['feed_image']);
}
function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
global $wpdb;
// TODO: Move select to get_authors().
$query = "SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name";
$authors = $wpdb->get_results($query);