[wp-trac] [WordPress Trac] #41427: wp_set_object_terms creates new terms instead of linking existing ones

WordPress Trac noreply at wordpress.org
Mon Jul 24 18:22:06 UTC 2017


#41427: wp_set_object_terms creates new terms instead of linking existing ones
--------------------------+-----------------------------
 Reporter:  martin.krcho  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  4.8
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Function {{{wp_set_object_terms}}} doesn't behave as expected. When I pass
 an ID of an existing term (integer) as {{{$terms}}} parameter, it creates
 a new term with given ID as a slug. This is most likely due to one of the
 plugins I use, but the problem goes away when I change lines 2241 and 2242
 in {{{taxonomy.php}}} to the following:
 {{{
 $term_ids[] = intval($term_info['term_id']);
 $tt_id = intval($term_info['term_taxonomy_id']);
 }}}
 Would you consider adding this to the next version as a failsafe?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41427>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list