get_page_hierarchy ( $pages, $page_id = 0 )
- (array) $pages Posts array (passed by reference).
- (int) $page_id Optional. Parent page ID. Default 0.
- (array) A list arranged by hierarchy. Children immediately follow their parents.
- Introduced in WordPress: 2.0.0
- Deprecated in WordPress: —
Order the pages with children under parents in a flat list.
It uses auxiliary structure to hold parent-children relationships and
runs in O(N) complexity