Ticket #9902: 9902.diff
File 9902.diff, 1.8 KB (added by , 15 years ago) |
---|
-
wp-includes/author-template.php
234 234 * author's name.</li> 235 235 * <li>exclude_admin (boolean) (true): Exclude the 'admin' user that is 236 236 * installed bydefault.</li> 237 * <li>exclude (string) (false): Exlude a list of authors based on user_ID.</li> 237 238 * <li>show_fullname (boolean) (false): Show their full names.</li> 238 239 * <li>hide_empty (boolean) (true): Don't show authors without any posts.</li> 239 240 * <li>feed (string) (''): If isn't empty, show links to author's feeds.</li> … … 259 260 'optioncount' => false, 'exclude_admin' => true, 260 261 'show_fullname' => false, 'hide_empty' => true, 261 262 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true, 262 'style' => 'list', 'html' => true 263 'style' => 'list', 'html' => true, 'exclude' => false 263 264 ); 264 265 265 266 $r = wp_parse_args( $args, $defaults ); … … 267 268 $return = ''; 268 269 269 270 /** @todo Move select to get_authors(). */ 270 $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin'" : '') . "ORDER BY display_name");271 $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin && $exclude ? "WHERE user_login <> 'admin' AND ID NOT IN (" . $exclude . ") " : '') . ($exclude_admin && !$exclude ? "WHERE user_login <> 'admin' " : '') . (!$exclude_admin && $exclude ? "WHERE ID NOT IN (" . $exclude . ") " : '') . "ORDER BY display_name"); 271 272 272 273 $author_count = array(); 273 274 foreach ((array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author") as $row) {