_page_traverse_name

函数


_page_traverse_name ( $page_id, $children, $result )
Access
Private
参数
  • (int)
    $page_id
    Page ID.
    Required:
  • (array)
    $children
    Parent-children relations (passed by reference).
    Required:
  • (string[])
    $result
    Array of page names keyed by ID (passed by reference).
    Required:
相关
  • _page_traverse_name()
定义位置
  • wp-includes/post.php
    , line 5882
引入
2.9.0
弃用

Traverses 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 );
		}
	}
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。