get_page_hierarchy


get_page_hierarchy ( $pages, $page_id = 0 )

Parameters:
  • (array) $pages Posts array (passed by reference).
  • (int) $page_id Optional. Parent page ID. Default 0.
Returns:
  • (array) A list arranged by hierarchy. Children immediately follow their parents.
Defined at:

Description

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

Related Functions

_get_term_hierarchy, get_page_uri, get_page_link, get_page_children, get_page_template

Top Google Results

User discussions

wpseek mobile