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() { function tinymce_include() {
wp_print_script( 'wp_tiny_mce' ); 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 = '') { function wp_list_authors($args = '') {
parse_str($args, $r); if ( is_array($args) )
$r = &$args;
else
parse_str($args, $r);
if ( !isset($r['optioncount']) ) $defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true,
$r['optioncount'] = false; 'feed' => '', 'feed_image' => '');
if ( !isset($r['exclude_admin']) ) $r = array_merge($defaults, $r);
$r['exclude_admin'] = true; extract($r);
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'] = '';
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; 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"; $query = "SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name";
$authors = $wpdb->get_results($query); $authors = $wpdb->get_results($query);