Changeset 12699 for trunk/wp-includes/author-template.php
- Timestamp:
- 01/11/2010 10:23:58 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/author-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/author-template.php
r12697 r12699 270 270 271 271 /** @todo Move select to get_authors(). */ 272 if( is_multisite() ) { 273 $users = get_users_of_blog(); 274 $author_ids = array(); 275 foreach ( (array) $users as $user ) { 276 $author_ids[] = $user->user_id; 277 } 278 if ( count($author_ids) > 0 ) { 279 $author_ids=implode(',', $author_ids ); 280 $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" ); 281 } else { 282 $authors = array(); 283 } 284 } else { 285 $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name"); 286 } 272 $users = get_users_of_blog(); 273 $author_ids = array(); 274 foreach ( (array) $users as $user ) 275 $author_ids[] = $user->user_id; 276 if ( count($author_ids) > 0 ) { 277 $author_ids = implode(',', $author_ids ); 278 $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" ); 279 } else { 280 $authors = array(); 281 } 287 282 288 283 $author_count = array(); 289 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) {284 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 ) 290 285 $author_count[$row->post_author] = $row->count; 291 }292 286 293 287 foreach ( (array) $authors as $author ) {
Note:
See TracChangeset
for help on using the changeset viewer.