WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 7 years ago

#23636 closed enhancement (fixed)

Allow multiple slugs in get_terms

Reported by: jfarthing84 Owned by: boonebgorges
Milestone: 4.1 Priority: normal
Severity: normal Version: 3.5
Component: Taxonomy Keywords: has-patch needs-docs
Focuses: Cc:

Description

Just as the title says, sometimes I need to retrieve multiple term IDs from slugs. Rather than calling get_term_by over and over, it'd be better to be able to specify an array of slugs for get_terms.

Attachments (4)

taxonomy.patch (654 bytes) - added by jfarthing84 9 years ago.
Allow array of slugs in get_terms.
23636.patch (651 bytes) - added by jfarthing84 7 years ago.
Refresh patch against trunk.
23636.2.patch (1.8 KB) - added by dlh 7 years ago.
23636.3.patch (1.0 KB) - added by jfarthing84 7 years ago.
Make the 'slug' parameter description more verbose.

Download all attachments as: .zip

Change History (14)

@jfarthing84
9 years ago

Allow array of slugs in get_terms.

#1 @SergeyBiryukov
8 years ago

  • Version changed from trunk to 3.5

#2 @boonebgorges
7 years ago

  • Keywords needs-patch needs-refresh added; has-patch removed

@jfarthing84
7 years ago

Refresh patch against trunk.

#3 @jfarthing84
7 years ago

  • Keywords has-patch added; needs-patch needs-refresh removed

#4 @boonebgorges
7 years ago

  • Keywords needs-unit-tests added

Thanks for the refresh! It would be nice to have unit tests for the new functionality.

@dlh
7 years ago

#5 @dlh
7 years ago

23636.2.patch fixes a syntax typo in the previous patch and adds unit tests.

#6 @boonebgorges
7 years ago

  • Milestone changed from Awaiting Review to 4.1

#7 @boonebgorges
7 years ago

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

In 30042:

Allow 'slug' param of get_terms() to accept an array.

Props jfarthing84, dlh.
Fixes #23636.

#8 @DrewAPicture
7 years ago

  • Keywords needs-docs added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Unfortunately, the new parameter description for the slug argument is too vague. We need to say "slug or array of slugs" specifically.

@jfarthing84
7 years ago

Make the 'slug' parameter description more verbose.

#9 @jared_smith
7 years ago

  • Keywords needs-unit-tests removed

23636.2.patch contains unit tests, so I'm removing the "needs-unit-tests" keyword.

Last edited 7 years ago by jared_smith (previous) (diff)

#10 @boonebgorges
7 years ago

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

In 30086:

Be more specific in documentation of 'slug' param for get_terms().

Props jfarthing84.
Fixes #23636.

Note: See TracTickets for help on using tickets.