[wp-trac] Re: [WordPress Trac] #2516: Page order messed up with latest CVS

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 28 12:01:37 GMT 2006


#2516: Page order messed up with latest CVS
-----------------------+----------------------------------------------------
       Id:  2516       |      Status:  reopened                
Component:  General    |    Modified:  Tue Feb 28 12:01:37 2006
 Severity:  trivial    |   Milestone:  2.1                     
 Priority:  low        |     Version:  2.0.1                   
    Owner:  anonymous  |    Reporter:  abbaanthony             
-----------------------+----------------------------------------------------
Comment (by markjaquith):

 Ok, I think I got it.

 Two problems, you were adding $page to $parents... I changed it to add
 $previous_page to $parents... Insert "Luke, I am my father" joke here.

 Other problem was that you were using array_shift(), which was looking at
 the "uppermost" parent first, instead of the lowermost.  So it was looking
 at grandparent, not getting a match, and doing the </ul></li> dance.  We
 want to look at parents first and then move up to grandparents only if we
 don't get a match, so my patch uses array_pop()

 I can't believe I'm actually understanding this code... it was absolute
 soup to me an hour ago. :-D

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2516>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list