Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

get_page_hierarchy()

3 tags 1 category

get_page_hierarchy() — Orders 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

Inputs: $pages (WP_Post[]): Posts array (passed by reference). $page_id (int): Optional. Parent page ID. Default 0.

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

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…