[wp-trac] [WordPress Trac] #29624: wp_set_object_terms function append flag not working and overwriting existing terms

WordPress Trac noreply at wordpress.org
Thu Sep 11 16:50:53 UTC 2014


#29624: wp_set_object_terms function append flag not working and overwriting
existing terms
--------------------------+-----------------------------
 Reporter:  rxnlabs       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  4.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When trying to append taxonomy terms to a post using the
 wp_set_object_terms function, setting the append argument to true still
 causes the function to overwrite any existing terms attached to the post.

 The "if" statement used to check if the term should be appended is
 '''not''' is incorrect.

 A simple fix would be changing the code on
 https://core.trac.wordpress.org/browser/tags/4.0/src/wp-
 includes/taxonomy.php#L0.

 On line 2629 from:
 {{{
 if ( ! $append )
 }}}

 to:

 {{{
 if ( $append )
 }}}

 This fixes the issue and terms are appended instead of being overwritten.

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


More information about the wp-trac mailing list