WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 7 weeks ago

#16625 closed enhancement (fixed)

wp_dropdown_categories reqs (consistent) option_none_value

Reported by: rcain Owned by: wonderboymusic
Milestone: 4.0 Priority: normal
Severity: minor Version: 3.0.4
Component: Taxonomy Keywords: has-patch
Focuses: template Cc:

Description

wp_dropdown_categories sets option_none value="-1" without any means to override, whereas other similar funcs (eg:wp_dropdown_pages) use options_none value= and also provide method to override default (option_none_value).

please could we have a consistent set of values (and options interface) to all thee dropdown funcs and save us some unnecessary and messy extra coding. thanks.

Attachments (1)

16625.diff (3.3 KB) - added by solarissmoke 3 years ago.

Download all attachments as: .zip

Change History (11)

solarissmoke3 years ago

comment:1 solarissmoke3 years ago

  • Keywords has-patch added; needs-patch removed

Actually it is only wp_dropdown_pages that has an option_none_value. The other two don't. Here's a patch. It also tidies up some of the code.

comment:2 linuxologos3 years ago

  • Cc linuxologos@… added

comment:3 follow-up: rcain3 years ago

  • Owner set to rcain
  • Status changed from new to reviewing

blimey, that was quick. very many thanks solarissmoke.

you are right of course, wp_dropdown_pages is the odd one out - not wp_drop_down_categories or wp_dropdown_users - my apologies. i suppose this means we are stuck with a legacy inconsistency here, but this patch will help.

can i ask - when do patches get rolled up into core version?

comment:4 in reply to: ↑ 3 solarissmoke3 years ago

  • Owner rcain deleted

Replying to rcain:

can i ask - when do patches get rolled up into core version?

Once the senior developers have reviewed the ticket and approved the proposed changes.

PS ownership is generally assigned to/by the senior devs in charge of that component - not to the reporter.

comment:5 rcain3 years ago

Thanks for the info solarissmoke - good to know.

PS. sorry about ownership change - was accidental.

comment:6 dd323 years ago

  • Component changed from Canonical to Template

comment:7 nacin5 months ago

  • Component changed from Template to Taxonomy
  • Focuses template added

comment:8 wonderboymusic7 weeks ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from reviewing to closed

In 28564:

wp_dropdown_pages() allows option_none_value to be passed. Add that arg to the $defaults for wp_dropdown_users() and wp_dropdown_categories() as well.

Props solarissmoke.
Fixes #16625.

comment:9 DrewAPicture7 weeks ago

  • Milestone changed from Awaiting Review to 4.0
  • Resolution fixed deleted
  • Status changed from closed to reopened

[28564] missed updating the inline docs for wp_dropdown_users|categories().

comment:10 DrewAPicture7 weeks ago

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

In 28570:

Add inline documentation for the option_none_value argument added to wp_dropdown_users|categories() in [28564].

Fixes #16625.

Note: See TracTickets for help on using tickets.