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

WordPress Trac noreply at wordpress.org
Sun Sep 11 16:26:57 UTC 2016


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

 * keywords:  has-patch 4.7-early => needs-patch 2nd-opinion
 * milestone:  Future Release => 4.7


Comment:

 Replying to [comment:10 helen]:
 > Related/possibly a duplicate: #14877
 >
 > I think it'd be perfectly reasonable to get what exists working with
 both IDs and slugs as appropriate in this ticket and then using that to
 model new callbacks after. And I'd love to see that happen.

 If we're headed for a future where WP provides more than just two meta box
 callbacks for taxonomies, then we may want to opt for something a bit more
 sophisticated here than an if/else toggle. I'm thinking something like a
 `meta_box_save_cb` alongside `meta_box_cb`. We'll have an internal matrix
 that can be used to provide default mappings of `meta_box_cb` to
 `meta_box_save_cb`:

 {{{
 // register_taxonomy()
 if ( null === $args['meta_box_save_cb'] ) ) {
     switch ( $args['meta_box_cb'] ) {
         case 'post_categories_meta_box' :
             $args['meta_box_save_cb'] = 'meta_box_save_cb_checkboxes';
         break;

         case 'post_tags_meta_box' :
         default:
             $args['meta_box_save_cb'] = 'meta_box_save_cb_input';
         break;

     }
 }
 }}}

 The format of `tax_input` and the corresponding validation required will
 look a bit different for `select`, `multiselect`, `radio`, so they should
 each probably get their own `meta_box_save_cb`. This provides that
 framework. Thoughts?

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


More information about the wp-trac mailing list