WPDev.one
Core Function
View Source on Trac ↗

get_page_hierarchy()

get_page_hierarchy( mixed $pages, mixed $page_id = 0 )

Orders the pages with children under parents in a flat list.

Parameters 1 required

Name / Type Description
$pages
WP_Post[]

Posts array (passed by reference).

Required
$page_id
int

Optional. Parent page ID. Default 0.

Return Value

(string[])
Array of post names keyed by ID and arranged by hierarchy. Children immediately follow their parents.

Function Information

Since Version
2.0.0
Source File
wp-includes/post.php
Advertisement