[wp-trac] [WordPress Trac] #33483: Logic error in wp_delete_term

WordPress Trac noreply at wordpress.org
Fri Aug 21 13:24:51 UTC 2015


#33483: Logic error in wp_delete_term
--------------------------+-----------------------------
 Reporter:  ipm-frommen   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Yesterday I was debugging some stuff related to term deletion. That's when
 I saw [https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/taxonomy.php?marks=2498-2503#L2496 this]:


 {{{
 if ( isset( $args['default'] ) ) {
     $default = (int) $args['default'];
     if ( ! term_exists( $default, $taxonomy ) ) {
         unset( $default );
     }
 }
 }}}

 In effect, this does something like `unset( 1 );` (in case the term with
 ID 1 is the default term). I suppose, this should be `unset(
 $args['default'] );`, right?

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


More information about the wp-trac mailing list