Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19584 closed feature request (wontfix)

Ability to use wp_insert_term to add multiple terms (pass term as array)

Reported by: ZaneMatthew Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: Taxonomy Keywords:
Focuses: Cc:


This would be a feature request, that being to allow wp_insert_term to take (both a string and) array as the argument for the $term.

wp_set_post_terms() can take a string or array as an argument for tags as outlined in the codex.

Change History (2)

#1 @scribu
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I see no point in doing this. Unlike wp_set_post_terms(), wp_insert_term() also accepts an array of additional parameters for the term.

We wouldn't make wp_insert_post() accept an array.

Just use a foreach loop or make a wrapper function if you need to do this often.

Version 1, edited 4 years ago by scribu (previous) (next) (diff)

#2 @ZaneMatthew
4 years ago

Thats exactly what i did just thought I'd pitch it :D

Note: See TracTickets for help on using tickets.