[wp-trac] Re: [WordPress Trac] #4351: Modify Walker_Page to add current_page_tree class for some style

WordPress Trac wp-trac at lists.automattic.com
Mon Jan 28 20:04:36 GMT 2008


#4351: Modify Walker_Page to add current_page_tree class for some style
-------------------------------------------------+--------------------------
 Reporter:  ev3rywh3re                           |        Owner:  anonymous
     Type:  enhancement                          |       Status:  new      
 Priority:  normal                               |    Milestone:  2.5      
Component:  Template                             |      Version:  2.3      
 Severity:  normal                               |   Resolution:           
 Keywords:  Walker_Page wp_list_pages has-patch  |  
-------------------------------------------------+--------------------------
Comment (by hailin):

 Thanks for proposing the patch, it is well thought-out and in pretty good
 shape.
 I have a few observations and suggestions:

 Ideally, the _current_page should be assigned in the constructor when
 Walker_Page class is first created.
 However, since we are still sticking to php4 class format, I think
 assigning it in start_lvl is ok.

 $marker_page_parent  the default invalid value should be set to something
 non-zero, such as –1, because top level pages have parent 0;
 –1 will always be invalid, thus it is safer in the future.

 Beside, shall we use _current_page_parent,
 instead of marker_page_parent as it is more consistent?

 In light of this, in the initialization:

 var $_current_page_parent  = -1;

 Since this Walker_Page is used in many places, we need to do careful
 testing and regression, including the page widgets,  page listing on
 sidebar, etc.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4351#comment:5>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list