Make WordPress Core


Ignore:
Timestamp:
01/11/2010 09:49:40 PM (12 years ago)
Author:
wpmuguru
Message:

merge in multisite login, wp-includes, See #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/author-template.php

    r12680 r12697  
    270270
    271271    /** @todo Move select to get_authors(). */
    272     $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name");
     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        }
    273287
    274288    $author_count = array();
Note: See TracChangeset for help on using the changeset viewer.