WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30611 closed enhancement (fixed)

get_terms() should support `name` argument

Reported by: danielbachhuber Owned by: boonebgorges
Milestone: 4.2 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

A la slug argument

Attachments (1)

30611.1.diff (3.4 KB) - added by danielbachhuber 5 years ago.
Support name argument for get_terms()

Download all attachments as: .zip

Change History (5)

@danielbachhuber
5 years ago

Support name argument for get_terms()

#1 @boonebgorges
5 years ago

  • Milestone changed from Future Release to 4.2

Looks good to me. This will require a change to wp_dropdown_categories(), because that function takes a 'name' parameter (for a totally different purpose) and passes it along dumbly to get_terms(). (Hooray for unit tests!)

#2 @boonebgorges
5 years ago

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

In 31024:

Introduce 'name' parameter for get_terms().

This enhancement requires a modification in the way that wp_dropdown_categories()
prepares its arguments for get_terms(), so that its unrelated 'name' param is
not mistaken for the new 'name' argument in get_terms().

Props danielbachhuber.
Fixes #30611.

#3 @travisnorthcutt
5 years ago

I updated the codex to reflect this change; a sanity check there would be appreciated.

#4 @boonebgorges
5 years ago

Thanks, travisnothcutt - I made a small edit to show that this param (as well as 'slug') accepts an array.

Note: See TracTickets for help on using tickets.