Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#13468 closed defect (bug) (fixed)

wp_dropdown_users() selected parameter doesn't respect show_option_none

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: 3.0 Priority: normal
Severity: minor Version: 3.0
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

In wp_dropdown_users() you can pass a string as the show_option_none parameter and an option will be added with that string and a value of '-1'. If you pass '-1' as the selected parameter however, this option will not be selected as the relevant check is missing from the function.

Attachments (2)

13468.patch (648 bytes) - added by johnbillion 15 years ago.
13468-2.patch (947 bytes) - added by johnbillion 15 years ago.

Download all attachments as: .zip

Change History (6)

@johnbillion
15 years ago

#1 @johnbillion
15 years ago

  • Keywords has-patch added

patch

Note that the same thing isn't needed for the show_option_all option as this will be selected by default if the selected parameter is missing or 0.

#2 @nacin
15 years ago

  • Keywords needs-refresh added

Happy to put this in -- we can use selected() here.

#3 @johnbillion
15 years ago

  • Keywords needs-refresh removed

refreshed patch

Just checked the other wp_dropdown_* functions. They're all ok except wp_dropdown_pages() which appears to have the same problem with the show_option_no_change parameter.

#4 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14779]) Fix showing selected for none. Props johnbillion. fixes #13468

Note: See TracTickets for help on using tickets.