[wp-trac] [WordPress Trac] #14662: Posts and Terms APIs allow loops in hierarchical data

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 11 21:14:38 UTC 2010

#14662: Posts and Terms APIs allow loops in hierarchical data
 Reporter:  mdawaffe      |       Owner:  westi          
     Type:  defect (bug)  |      Status:  accepted       
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.0.1          
 Severity:  normal        |    Keywords:                 

Comment(by ryan):

 I started on a simple-minded patch before noticing this ticket.
 Basically, it adds simple loop detection to _get_post_ancestors(), makes
 sure ->ancestors is always populated after calling get_post(), and moves
 places doing their own loops to use ->ancestors.  The loop detection just
 looks to see if an ID is repeated anywhere in the ancestry. It doesn't try
 to do full loop detection like Mike's patch.  Mike's better detection
 triggered via filters could be merged in with my ancestors cleanup.

 The ancestors cleanup also fixes issues like #10381 and #14329.

Ticket URL: <http://core.trac.wordpress.org/ticket/14662#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list