[wp-trac] Re: [WordPress Trac] #5373: wp_list_pages - set 'hierarchical' to 0 on 'include'

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 31 17:44:12 GMT 2007


#5373: wp_list_pages - set 'hierarchical' to 0 on 'include'
----------------------------------------------------------------+-----------
 Reporter:  Kafkaesqui                                          |        Owner:  anonymous
     Type:  defect                                              |       Status:  reopened 
 Priority:  normal                                              |    Milestone:  2.3.2    
Component:  General                                             |      Version:  2.3.2    
 Severity:  normal                                              |   Resolution:           
 Keywords:  wp_list_pages include hierarchical child has-patch  |  
----------------------------------------------------------------+-----------
Changes (by wlindley):

  * status:  closed => reopened
  * version:  2.3.1 => 2.3.2
  * resolution:  fixed =>

Comment:

 I have written a plugin that depends on hierarchical=1 along with include=
 ... specifically, I create a page-list that shows an indented "breadcrumb-
 style" list of pages from top-level down to your current location, along
 with all the current page's "brothers" and "uncles" etc. up to the main
 level.

 The patch in v2.3.2 breaks this functionality, because my
 "&hierarchical=1" gets overridden, and the page structure collapses.

 In other words, $hierarchical needs to default to 1 if &include= is not
 specified, and default to 0 if &include= is specified. But now, when
 explicitly specifying both, hierarchical gets discarded.

 One way to solve this is change line 1146 to be:

 {{{
 if ($hierarchical == 1) $hierarchical = false;
 }}}


 and line 1126, make the default "2" (so an explicit "1" won't override):


 {{{
 'sort_column' => 'post_title', 'hierarchical' => 2,
 }}}


 Perhaps there's a more elegant way of making a "dependent default" but
 this makes all cases work.

 -- \\/illiam

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


More information about the wp-trac mailing list