get_pages() not ordering as it should

This is indeed an error, and probably caused by the child_of argument.

Because child_of requests the whole subtree of the given page (not only the direct children, but also children of those children and so on), WordPress first queries for all the pages and then selects a subset of those pages. The first query respects the order, but the second subselection messes this up by just using array_merge().

I have created a Trac ticket for this.

Leave a Comment