WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 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:

Description

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)

comment:1 scribu2 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 of arrays.

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

Last edited 2 years ago by scribu (previous) (diff)

comment:2 ZaneMatthew2 years ago

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

Note: See TracTickets for help on using tickets.