_page_traverse_name

The timeline below displays how wordpress function _page_traverse_name has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Traverses and return all the nested children post names of a root page.
 *
 * $children contains parent-children relations
 *
 * @since 2.9.0
 * @access private
 *
 * @see _page_traverse_name()
 *
 * @param int      $page_id  Page ID.
 * @param array    $children Parent-children relations (passed by reference).
 * @param string[] $result   Array of page names keyed by ID (passed by reference).
 */
function _page_traverse_name($page_id, &$children, &$result)
{
    if (isset($children[$page_id])) {
        foreach ((array) $children[$page_id] as $child) {
            $result[$child->ID] = $child->post_name;
            _page_traverse_name($child->ID, $children, $result);
        }
    }
}

WordPress Version: 5.4

/**
 * Traverse and return all the nested children post names of a root page.
 *
 * $children contains parent-children relations
 *
 * @since 2.9.0
 * @access private
 *
 * @see _page_traverse_name()
 *
 * @param int      $page_id  Page ID.
 * @param array    $children Parent-children relations (passed by reference).
 * @param string[] $result   Array of page names keyed by ID (passed by reference).
 */
function _page_traverse_name($page_id, &$children, &$result)
{
    if (isset($children[$page_id])) {
        foreach ((array) $children[$page_id] as $child) {
            $result[$child->ID] = $child->post_name;
            _page_traverse_name($child->ID, $children, $result);
        }
    }
}

WordPress Version: 5.1

/**
 * Traverse and return all the nested children post names of a root page.
 *
 * $children contains parent-children relations
 *
 * @since 2.9.0
 * @access private
 *
 * @see _page_traverse_name()
 *
 * @param int   $page_id   Page ID.
 * @param array $children  Parent-children relations (passed by reference).
 * @param array $result    Result (passed by reference).
 */
function _page_traverse_name($page_id, &$children, &$result)
{
    if (isset($children[$page_id])) {
        foreach ((array) $children[$page_id] as $child) {
            $result[$child->ID] = $child->post_name;
            _page_traverse_name($child->ID, $children, $result);
        }
    }
}

WordPress Version: 4.9

/**
 * Traverse and return all the nested children post names of a root page.
 *
 * $children contains parent-children relations
 *
 * @since 2.9.0
 *
 * @see _page_traverse_name()
 *
 * @param int   $page_id   Page ID.
 * @param array $children  Parent-children relations (passed by reference).
 * @param array $result    Result (passed by reference).
 */
function _page_traverse_name($page_id, &$children, &$result)
{
    if (isset($children[$page_id])) {
        foreach ((array) $children[$page_id] as $child) {
            $result[$child->ID] = $child->post_name;
            _page_traverse_name($child->ID, $children, $result);
        }
    }
}

WordPress Version: 4.5

/**
 * Traverse and return all the nested children post names of a root page.
 *
 * $children contains parent-children relations
 *
 * @since 2.9.0
 *
 * @see _page_traverse_name()
 *
 * @param int   $page_id   Page ID.
 * @param array $children  Parent-children relations, passed by reference.
 * @param array $result    Result, passed by reference.
 */
function _page_traverse_name($page_id, &$children, &$result)
{
    if (isset($children[$page_id])) {
        foreach ((array) $children[$page_id] as $child) {
            $result[$child->ID] = $child->post_name;
            _page_traverse_name($child->ID, $children, $result);
        }
    }
}

WordPress Version: 4.0

/**
 * Traverse and return all the nested children post names of a root page.
 *
 * $children contains parent-children relations
 *
 * @since 2.9.0
 *
 * @see _page_traverse_name()
 *
 * @param int   $page_id   Page ID.
 * @param array &$children Parent-children relations, passed by reference.
 * @param array &$result   Result, passed by reference.
 */
function _page_traverse_name($page_id, &$children, &$result)
{
    if (isset($children[$page_id])) {
        foreach ((array) $children[$page_id] as $child) {
            $result[$child->ID] = $child->post_name;
            _page_traverse_name($child->ID, $children, $result);
        }
    }
}

WordPress Version: 3.7

/**
 * function to traverse and return all the nested children post names of a root page.
 * $children contains parent-children relations
 *
 * @since 2.9.0
 */
function _page_traverse_name($page_id, &$children, &$result)
{
    if (isset($children[$page_id])) {
        foreach ((array) $children[$page_id] as $child) {
            $result[$child->ID] = $child->post_name;
            _page_traverse_name($child->ID, $children, $result);
        }
    }
}