mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Mainstream things that don't need to be multisite only. Formatting cleanups. see #11644
git-svn-id: https://develop.svn.wordpress.org/trunk@12699 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -269,26 +269,20 @@ function wp_list_authors($args = '') {
|
||||
$return = '';
|
||||
|
||||
/** @todo Move select to get_authors(). */
|
||||
if( is_multisite() ) {
|
||||
$users = get_users_of_blog();
|
||||
$author_ids = array();
|
||||
foreach ( (array) $users as $user ) {
|
||||
$author_ids[] = $user->user_id;
|
||||
}
|
||||
if ( count($author_ids) > 0 ) {
|
||||
$author_ids=implode(',', $author_ids );
|
||||
$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" );
|
||||
} else {
|
||||
$authors = array();
|
||||
}
|
||||
} else {
|
||||
$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name");
|
||||
}
|
||||
$users = get_users_of_blog();
|
||||
$author_ids = array();
|
||||
foreach ( (array) $users as $user )
|
||||
$author_ids[] = $user->user_id;
|
||||
if ( count($author_ids) > 0 ) {
|
||||
$author_ids = implode(',', $author_ids );
|
||||
$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" );
|
||||
} else {
|
||||
$authors = array();
|
||||
}
|
||||
|
||||
$author_count = array();
|
||||
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) {
|
||||
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 )
|
||||
$author_count[$row->post_author] = $row->count;
|
||||
}
|
||||
|
||||
foreach ( (array) $authors as $author ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user