WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 7 years ago

Last modified 7 years ago

#12494 closed enhancement (fixed)

Allow selectable value in Walker_*Dropdown classes

Reported by: jfarthing84 Owned by: boonebgorges
Milestone: 4.2 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: dev-feedback has-patch
Focuses: template Cc:

Description

I think we should be able to select either term_id or term_slug as the output value for Walker_CategoryDropdown class and likewise either ID or post_name for Walker_PageDropdown class.

Attachments (2)

12494.diff (1.3 KB) - added by jfarthing84 12 years ago.
12494.patch (2.9 KB) - added by jfarthing84 7 years ago.
Refresh against [30972]

Download all attachments as: .zip

Change History (10)

@jfarthing84
12 years ago

#1 @jfarthing84
12 years ago

In researching this, I noticed that many different relating functions use the filter 'list_cats' on many different attributes, which seems misguided, because how do you differentiate between the attributes? Shouldn't each one have it's own filter?

#2 @nacin
12 years ago

  • Milestone changed from Unassigned to Future Release

@jfarthing84
7 years ago

Refresh against [30972]

#4 @DrewAPicture
7 years ago

  • Component changed from General to Taxonomy

#5 @boonebgorges
7 years ago

  • Component changed from Taxonomy to Posts, Post Types
  • Focuses template added
  • Milestone changed from Future Release to 4.2

The wp_dropdown_categories() part of this was duplicated in #30306 and resolved in [31006].

Let's extend the same syntax here, using the 'value_field' parameter name.

#6 @boonebgorges
7 years ago

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

In 31338:

Introduce 'value_field' parameter to wp_dropdown_pages().

This parameter allows developers to choose the post field that will be used to
fill in the 'option' attribute of the generated dropdown markup.

See [31006] #30306 for a parallel enhancement in wp_dropdown_categories().

Props jfarthing84.
Fixes #12494.

#7 @DrewAPicture
7 years ago

In 31355:

Add documentation for the $value_field argument added to wp_dropdown_pages() in [31338].

See #12494.

#8 @DrewAPicture
7 years ago

In 31356:

Adjust the DocBlock for wp_dropdown_pages() to mark the entire $args parameter array as optional instead of each individual argument.

See #12494.

Note: See TracTickets for help on using tickets.