[wp-trac] [WordPress Trac] #28033: post_categories_meta_box on non-hierarchical custom taxonomy

WordPress Trac noreply at wordpress.org
Fri Apr 25 20:56:56 UTC 2014


#28033: post_categories_meta_box on non-hierarchical custom taxonomy
---------------------------+------------------------------
 Reporter:  ByronicEntity  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  General        |     Version:  3.9
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by ByronicEntity):

 Replying to [ticket:28033 ByronicEntity]:
 > Slightly based on the work done in #14206
 >
 > Using a non-hierarchical custom taxonomy in combination with meta_box_cb
 'post_categories_meta_box'. Creates a new term with the id name of the
 selected term_id on submission. (See attached file)
 >
 > First time added term "Custom", selected it
 > Published post. (It auto added the term "207")
 > Published post. (It auto added the term "208")


 /wp-includes/post.php:
 line: 3171:
 $tags = array_filter($tags);

 Should be changed imho to:
 $tags = array_map('intval', array_filter($tags));

 Since hierachical terms should be passed by id instead of names.

 Changing this allows non hierachical taxonomies with custom callbacks like
 this one, to submit by an array of id's instead of a list of strings
 containing mutliple terms

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


More information about the wp-trac mailing list