Forums

Put Navigation Tree into PHP Array (1 post)

  1. Ryan Fait
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.