Ticket #9902: 9902.2.diff
File 9902.2.diff, 1.6 KB (added by , 15 years ago) |
---|
-
wp-includes/author-template.php
248 248 * author's name.</li> 249 249 * <li>exclude_admin (boolean) (true): Exclude the 'admin' user that is 250 250 * installed bydefault.</li> 251 * <li>exclude (string) (false): Exlude a list of authors based on user_ID.</li> 251 252 * <li>show_fullname (boolean) (false): Show their full names.</li> 252 253 * <li>hide_empty (boolean) (true): Don't show authors without any posts.</li> 253 254 * <li>feed (string) (''): If isn't empty, show links to author's feeds.</li> … … 273 274 'optioncount' => false, 'exclude_admin' => true, 274 275 'show_fullname' => false, 'hide_empty' => true, 275 276 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true, 276 'style' => 'list', 'html' => true 277 'style' => 'list', 'html' => true, 'exclude' => false 277 278 ); 278 279 279 280 $r = wp_parse_args( $args, $defaults ); … … 282 283 283 284 /** @todo Move select to get_authors(). */ 284 285 $users = get_users_of_blog(); 286 287 if($exclude) 288 $exclude = explode(',',$exclude); 289 else 290 $exclude = array(); 291 285 292 $author_ids = array(); 286 293 foreach ( (array) $users as $user ) 287 $author_ids[] = $user->user_id; 294 if ( ! in_array( $user->user_id, $exclude, false ) ) 295 $author_ids[] = $user->user_id; 296 288 297 if ( count($author_ids) > 0 ) { 289 298 $author_ids = implode(',', $author_ids ); 290 299 $authors = $wpdb->get_results( "SELECT ID, user_nicename from $wpdb->users WHERE ID IN($author_ids) " . ($exclude_admin ? "AND user_login <> 'admin' " : '') . "ORDER BY display_name" );