Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#23636 closed enhancement (fixed)

Allow multiple slugs in get_terms

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

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 13 years ago.
Allow array of slugs in get_terms.
23636.patch (651 bytes ) - added by jfarthing84 12 years ago.
Refresh patch against trunk.
23636.2.patch (1.8 KB ) - added by dlh 12 years ago.
23636.3.patch (1.0 KB ) - added by jfarthing84 12 years ago.
Make the 'slug' parameter description more verbose.

Download all attachments as: .zip

Change History (14)

@jfarthing84
13 years ago

Allow array of slugs in get_terms.

#1 @SergeyBiryukov
13 years ago

  • Version trunk3.5

#2 @boonebgorges
12 years ago

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

@jfarthing84
12 years ago

Refresh patch against trunk.

#3 @jfarthing84
12 years ago

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

#4 @boonebgorges
12 years ago

  • Keywords needs-unit-tests added

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

@dlh
12 years ago

#5 @dlh
12 years ago

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

#6 @boonebgorges
12 years ago

  • Milestone Awaiting Review4.1

#7 @boonebgorges
12 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

In 30042:

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

Props jfarthing84, dlh.
Fixes #23636.

#8 @DrewAPicture
12 years ago

  • Keywords needs-docs added
  • Resolution fixed
  • Status closedreopened

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

@jfarthing84
12 years ago

Make the 'slug' parameter description more verbose.

#9 @jared_smith
12 years ago

  • Keywords needs-unit-tests removed

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

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

#10 @boonebgorges
12 years ago

  • Resolutionfixed
  • Status reopenedclosed

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.