[wp-trac] [WordPress Trac] #36514: posting with custom taxes

WordPress Trac noreply at wordpress.org
Sun Apr 17 03:56:28 UTC 2016


#36514: posting with custom taxes
-----------------------------------+-----------------------------
 Reporter:  hokku                  |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  4.6
Component:  Taxonomy               |     Version:  4.2
 Severity:  major                  |  Resolution:
 Keywords:  2nd-opinion has-patch  |     Focuses:  administration
-----------------------------------+-----------------------------
Changes (by boonebgorges):

 * keywords:   => 2nd-opinion has-patch
 * milestone:  Awaiting Review => 4.6


Comment:

 Thanks for the details, @hokku. As I'd guessed, you're specifying
 `post_categories_meta_box` for a non-hierarchical taxonomy, which is
 confusing the logic introduced in [31359].

 We need something more specific, which will tell `edit_post()` when it
 ought to be converting 'tax_input' values to term IDs. It's hard to think
 of a very elegant way to do this. [attachment:36514.diff] is my best idea:
 a new `meta_box_expect_ids` param for `register_taxonomy()`, which
 defaults to `true` when the meta_box_cb is 'post_categories_meta_box'
 (either explicitly or as fallback, based on `hierarchical`). Then, in
 `edit_post()`, we check this value instead of
 `is_taxonomy_hierarchical()`.

 This technique is not a beautiful piece of software craftsmanship, but it
 will only ever matter for people who are providing a `meta_box_cb` other
 than the defaults from core, which is hardly anyone.

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


More information about the wp-trac mailing list