_page_traverse_name( int $page_id, array $children, array $result )
Traverse and return all the nested children post names of a root page.
Description
$children contains parent-children relations
See also
Parameters
- $page_id
-
(Required) Page ID.
- $children
-
(Required) Parent-children relations (passed by reference).
- $result
-
(Required) Result (passed by reference).
Source
File: wp-includes/post.php
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 );
}
}
}
Changelog
Version | Description |
---|---|
WP-2.9.0 | Introduced. |