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

I have a custom meta box with a dropdown displaying all the WP users via wp_dropdown_users. It saves which WP user is chosen with the post, so that all works.

However, is there a way to make it show the selected user in the dropdown when going back to edit, rather than the first in the list? I've used the selected() function for another dropdown but I've created that dynamically. I've tried to implement selected() with wp_dropdown_users, but it hasn't worked so I'm not sure if it's even possible?


share|improve this question
up vote 1 down vote accepted

You need to set selected argument for the wp_dropdown_users function. Do it like this:

wp_dropdown_users( array( 
    // ...
    'selected' => $user_id,
    // ...
) );

Read documentation for wp_dropdown_users function

share|improve this answer
Thank you! I thought it was that at first but I thought it required an actual ID number. End of semester, brain not working right. Thanks again! – CourtFantinato Apr 14 '12 at 17:11
You are welcome! – Eugene Manuilov Apr 14 '12 at 18:18

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.