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

WordPress Trac wp-trac at lists.automattic.com
Wed Jan 5 05:27:06 UTC 2011


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

Comment (by foofy):

 This is only a problem if you make multiple term changes in the same PHP
 request/script lifetime. clean_term_cache() tracks each taxonomy it cleans
 in a static variable and won't clean it a second time.  If several term
 changes are made in the same request, the {$taxonomy}_children option is
 left with the hierarchy as it was after the first change.

 _get_term_hierarchy() has the only other reference to that option and is
 responsible for repopulating it if it's empty, so it seems safe to delete
 the option manually.

 I don't know why it doesn't clear a taxonomy more than once (I guess it's
 performance-related) so I didn't want to mess with that, but I think the
 $clean_taxonomy parameter was meant to be an override that got neutered at
 some point.

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


More information about the wp-trac mailing list