Changeset 3848

Show
Ignore:
Timestamp:
06/06/06 04:50:41 (3 years ago)
Author:
ryan
Message:

Deprecate list_authors(). Clean up wp_list_authors().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/deprecated.php

    r3788 r3848  
    457457    wp_print_script( 'wp_tiny_mce' ); 
    458458} 
     459 
     460function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { 
     461    $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); 
     462    return wp_list_authors($args); 
     463} 
     464 
    459465?> 
  • trunk/wp-includes/template-functions-author.php

    r3205 r3848  
    157157 
    158158function wp_list_authors($args = '') { 
    159     parse_str($args, $r); 
    160  
    161     if ( !isset($r['optioncount']) ) 
    162         $r['optioncount'] = false; 
    163     if ( !isset($r['exclude_admin']) ) 
    164         $r['exclude_admin'] = true; 
    165     if ( !isset($r['show_fullname']) ) 
    166         $r['show_fullname'] = false; 
    167     if ( !isset($r['hide_empty']) ) 
    168         $r['hide_empty'] = true; 
    169     if ( !isset($r['feed']) ) 
    170         $r['feed'] = ''; 
    171     if ( !isset($r['feed_image']) ) 
    172         $r['feed_image'] = ''; 
    173  
    174     list_authors($r['optioncount'], $r['exclude_admin'], $r['show_fullname'], $r['hide_empty'], $r['feed'], $r['feed_image']); 
    175 
    176  
    177 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { 
     159    if ( is_array($args) ) 
     160        $r = &$args; 
     161    else 
     162        parse_str($args, $r); 
     163 
     164    $defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true, 
     165        'feed' => '', 'feed_image' => ''); 
     166    $r = array_merge($defaults, $r); 
     167    extract($r); 
     168 
    178169    global $wpdb; 
     170    // TODO:  Move select to get_authors(). 
    179171    $query = "SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name"; 
    180172    $authors = $wpdb->get_results($query);