WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

the post_author_meta_box uses wp_dropdown_users showing the user name of authors. How do I display the email address in brackets next the author's name? Can one filter the wp_dropdown users do to this?

share|improve this question
up vote 0 down vote accepted

the only filter hook called in wp_dropdown_users() function is wp_dropdown_users which pass a string of the dropdown in an html form so you can manipulate this dropdown at that hook with some major REGEX.

A better solution would be to use get_users() and create the dropdown your self, something like this:

$selected = 1; //just for example, you can get that by get_post_meta()
$siteusers = get_users(); // you can pass filters and option
$re = '';
if (count($siteusers) > 0){
    $re = '<select name="users_with_email">';
    foreach ($siteusers as $user) {
        $re .= '<option value="' . $user->ID . '">'.$user->user_nicename . ' ('.$user->user_email .')</option>';
    $re .= '</select>';
    $re = str_replace('value="' . $selected . '"','value="' . $selected . '" selected="selected"', $re );
echo $re;
share|improve this answer
I dont want to edit the core, how would one do this with a plugin? Is it possible to replace the wp_dropdown_users() function with my own and not break wp admin elsewhere? – Innate Jan 16 '12 at 18:34
ok nice.. figured this out thanks to you: pastebin.com/RD58LANm – Innate Jan 16 '12 at 21:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.