Handle empty authors list. Props MichaelH. fixes #2384
git-svn-id: http://svn.automattic.com/wordpress/trunk@4497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9f534ebae6
commit
4780071918
|
@ -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";
|
$query = "SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name";
|
||||||
$authors = $wpdb->get_results($query);
|
$authors = $wpdb->get_results($query);
|
||||||
|
|
||||||
foreach ( $authors as $author ) {
|
foreach ( (array) $authors as $author ) {
|
||||||
$author = get_userdata( $author->ID );
|
$author = get_userdata( $author->ID );
|
||||||
$posts = get_usernumposts($author->ID);
|
$posts = get_usernumposts($author->ID);
|
||||||
$name = $author->nickname;
|
$name = $author->nickname;
|
||||||
|
|
Loading…
Reference in New Issue