smeTea

function wp_list_authors and exclude_admin option

Hi, I would like to suggest wordpress and any of you consider to modify the function : wp_list_authors to handle the option exclude_admin.

foreach ( (array) $users as $user ) {
if ($exclude_admin && $user->meta_value == ‘a:1:{s:13:”administrator”;b:1;}’)
continue;

$author_ids[] = $user->user_id;
}

$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” );

The original in 2.7.1 will exclude the login “admin” only. The modified will be more flexible to exclude all user with the role of “administrator”.

Mark

Advertisements

21/05/2009 Posted by | codeX | 1 Comment