Handle empty authors list. Props MichaelH. fixes #2384
git-svn-id: https://develop.svn.wordpress.org/trunk@4497 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e44ea1ff93
commit
cb11b2ef85
@ -188,7 +188,7 @@ function wp_list_authors($args = '') {
|
||||
$query = "SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name";
|
||||
$authors = $wpdb->get_results($query);
|
||||
|
||||
foreach ( $authors as $author ) {
|
||||
foreach ( (array) $authors as $author ) {
|
||||
$author = get_userdata( $author->ID );
|
||||
$posts = get_usernumposts($author->ID);
|
||||
$name = $author->nickname;
|
||||
|
Loading…
Reference in New Issue
Block a user