• Does anyone have a code snippet that will put the parents and children of $post->ID into an array like this:

    array (
         [1] => 0,
         [3] => 0,
         [4] => array(19, 24, 36),
         [8] => array(41, 42, 43),
    )
    • The array key is the page ID
    • The value is 0 if there are no children
    • If there are children, the value is an array filled with their page ID’s

The topic ‘Put Navigation Tree into PHP Array’ is closed to new replies.