Opened 2 years ago

Last modified 2 years ago

#17015 new defect (bug)

wp_list_pages incorrect hierarchy when using include and sorting by title

Reported by: JohnColvin Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version: 3.1
Severity: minor Keywords:
Cc:

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

Change History (1)

exclude has similar weirdness, maybe the same root cause: #10902

Note: See TracTickets for help on using tickets.