[wp-trac] [WordPress Trac] #38508: wp_insert_term and [term_taxonomy_id] => 0 )

WordPress Trac noreply at wordpress.org
Wed Oct 26 09:04:40 UTC 2016


#38508: wp_insert_term and [term_taxonomy_id] => 0 )
--------------------------+-----------------------------
 Reporter:  staticweb     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hello,

 I use WordPress version: 4.6.1 and WooCommerce version 2.6.6 with
 XAMPP/WIN7.

 I want to import categories from osCommerce and i have some categories
 with [term_taxonomy_id] => 0 and no record in wp_term_taxonomy after
 wp_insert_term.

 I think this is a bug. If no record in wp_term_taxonomy is created a error
 should come.

 {{{
 $parent_term = term_exists($line["parent_categories_name"],
 'product_cat');
 wp_insert_term(
   $line["categories_name"],
   'product_cat',
   array(
     'description'=> $line["categories_description"],
     'slug' => $line["categories_slug"],
     'parent'=> $parent_term['term_id']
   )
 );
 }}}

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


More information about the wp-trac mailing list