Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#15320 closed defect (bug) (invalid)

tax_input does not work with category slugs

Reported by: linguasite Owned by:
Priority: normal Milestone:
Component: Taxonomy Version: 3.1
Severity: normal Keywords: taxonomy insert post category
Cc:

Description

When inserting/updating a post, the slugs of custom taxonomies can be stored in the tax_input array and will be assigned to the post or created if they do no exist.
However, the category taxonomy array in tax_input must contain the term_id's of the categories, otherwise the values will be ignored.

See /wp_includes/post.php line 2532.

Any ideas why this happens?

Change History (2)

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

This is intentional. Hierarchical taxonomies must use IDs since multiple terms can have the same slug as long as they belong to different branches/depths of the hierarchy.

http://core.trac.wordpress.org/browser/trunk/wp-includes/post.php?rev=17298#L2877

OK, got it, thanks.

Note: See TracTickets for help on using tickets.