[wp-trac] [WordPress Trac] #14704: _get_term_hierarchy() should check for populated array

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 15 22:05:43 UTC 2010


#14704: _get_term_hierarchy() should check for populated array
--------------------------+-------------------------------------------------
 Reporter:  zaremedia     |        Owner:          
     Type:  defect (bug)  |       Status:  reopened
 Priority:  normal        |    Milestone:          
Component:  General       |      Version:          
 Severity:  minor         |   Resolution:          
 Keywords:                |  
--------------------------+-------------------------------------------------
Changes (by somatic):

  * status:  closed => reopened
  * resolution:  worksforme =>


Comment:

 This problem is still affecting me, when programmatically spawning terms
 and specifying parents with wp_insert_term()

 {{{
 $kid_term = wp_insert_term( $kid, $taxonomy, array( 'parent'=> $parent_id,
 'slug'=> sanitize_title($kid) ) );
 }}}

 I can see the terms in the DB, and in wp_term_taxonomy table their parent
 *is* set, but the wp_option table items for {taxonomy}_children is stuck
 on an empty array.

 wp_insert_term() includes a call to clean_term_cache(), but if it's doing
 anything, it's still not updating the {taxonomy}_children field.

 If I manually (through the wp_admin interface) set a term to have a
 parent, the option gets updated and displays correctly.

 I've even included a call to clean_term_cache() after all my
 wp_insert_term() calls are done - still nothing.

 HOWEVER - if I go and delete one my terms in the wp_admin interface, the
 option gets updated - and of course clean_term_cache() is called in
 wp_delete_term() - so sometimes it's doing it's job and sometimes it's
 not....

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14704#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list