[wp-trac] [WordPress Trac] #30615: Flat Taxonomy Terms are idenfied via their slugs and not their names, when saved from thePost Edit Screen

WordPress Trac noreply at wordpress.org
Mon Dec 8 14:24:24 UTC 2014


#30615: Flat Taxonomy Terms are idenfied via their slugs and not their names, when
saved from thePost Edit Screen
-------------------------------------+------------------------------
 Reporter:  ArminBraun               |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  2nd-opinion needs-patch  |     Focuses:
-------------------------------------+------------------------------
Changes (by boonebgorges):

 * keywords:   => 2nd-opinion needs-patch


Comment:

 Confirmed. Here's the trace: `edit_post()` -> `wp_insert_post()` parses
 'tax_input' and passes to `wp_set_post_terms()` -> `wp_set_object_terms()`
 -> `term_exists()`. `term_exists()` will look for a 'slug' match before a
 'name' match.

 I agree that, in the case of the post.php interface, user expectation
 would probably be to match 'name' first. But I don't think this should be
 fixed all the way down the stack, since from a developer's point of view,
 'slug' is probably more of a canonical handle for the term. So a possible
 fix would be to pre-process 'tax_input' in `edit_post()` and convert names
 to slugs before calling `wp_insert_post()`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30615#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list