WordPress开发者和主题制作者的搜索引擎



_page_traverse_name ›

Since2.9.0
已弃用n/a
_page_traverse_name ( $page_id, $children, $result )
访问:
  • private
参数: (3)
  • (int) $page_id Page ID.
    Required: Yes
  • (array) $children Parent-children relations (passed by reference).
    Required: Yes
  • (array) $result Result (passed by reference).
    Required: Yes
查看:
定义在:
文档:

Traverse and return all the nested children post names of a root page.

$children contains parent-children relations



源码

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 );
		}
	}
}