[wp-trac] [WordPress Trac] #17015: wp_list_pages incorrect hierarchy when using include and sorting by title

WordPress Trac noreply at wordpress.org
Sat Aug 17 12:55:44 UTC 2013


#17015: wp_list_pages incorrect hierarchy when using include and sorting by title
--------------------------+------------------------------
 Reporter:  JohnColvin    |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Template      |     Version:  1.5
 Severity:  minor         |  Resolution:  invalid
 Keywords:                |
--------------------------+------------------------------
Changes (by SergeyBiryukov):

 * component:  General => Template


Old description:

> I am using wp_list_pages to create a page hierarchy. I only want the
> grandchildren of specific pages, so I generate a list of page IDs to send
> to wp_list_pages. I sort them by page title.  The hierarchy is not
> handled correctly when a grandchild's title sorts before its parent.
>
> How it should come out:[[BR]]
> About Us[[BR]]
>  -Board of Directors[[BR]]
>    --Annual Reports[[BR]]
>  -FAQ[[BR]]
>  -Initiatives[[BR]]
>   --Ohio...[[BR]]
>   --Reach[[BR]]
>
> How it comes out:[[BR]]
> About Us[[BR]]
>  -Annual Reports[[BR]]
>  -Board of Directors[[BR]]
>  -FAQ[[BR]]
>  -Initiatives[[BR]]
>   --Ohio...[[BR]]
>   --Reach[[BR]]
>
> I've moved things around and verified that this sorts correctly:[[BR]]
> About Us[[BR]]
>  -Board of Directors[[BR]]
>    --ZZZAnnual Reports[[BR]]
>  -FAQ[[BR]]
>  -Initiatives[[BR]]
>   --Ohio...[[BR]]
>   --Reach[[BR]]
>
> If one grandchild has a sort order above its parent, all the
> grandchildren are pulled above the parent in the hierarchy. For
> example:[[BR]]
> About Us[[BR]]
>  -Board of Directors[[BR]]
>    --ZZZAnnual Reports[[BR]]
>  -FAQ[[BR]]
>  -AAAAOhio...[[BR]]
>  -Reach[[BR]]
>  -Initiatives[[BR]]

New description:

 I am using wp_list_pages to create a page hierarchy. I only want the
 grandchildren of specific pages, so I generate a list of page IDs to send
 to wp_list_pages. I sort them by page title.  The hierarchy is not handled
 correctly when a grandchild's title sorts before its parent.

 How it should come out:
 {{{
 About Us
  -Board of Directors
    --Annual Reports
  -FAQ
  -Initiatives
   --Ohio...
   --Reach
 }}}
 How it comes out:
 {{{
 About Us
  -Annual Reports
  -Board of Directors
  -FAQ
  -Initiatives
   --Ohio...
   --Reach
 }}}
 I've moved things around and verified that this sorts correctly:
 {{{
 About Us
  -Board of Directors
    --ZZZAnnual Reports
  -FAQ
  -Initiatives
   --Ohio...
   --Reach
 }}}
 If one grandchild has a sort order above its parent, all the grandchildren
 are pulled above the parent in the hierarchy. For example:
 {{{
 About Us
  -Board of Directors
    --ZZZAnnual Reports
  -FAQ
  -AAAAOhio...
  -Reach
  -Initiatives
 }}}

--

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


More information about the wp-trac mailing list