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 »

  1. Hi, this is a comment.
    To delete a comment, just log in, and view the posts’ comments, there you will have the option to edit or delete them.

    Comment by Mr WordPress | 21/05/2009 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: