检索页面列表的HTML列表内容。

原型

walk_page_tree( array $pages, int $depth, int $current_page, array $r )

参数

$pages (array) (Required)

$depth (int) (Required)

$current_page (int) (Required)

$r (array) (Required)

返回值

(string)  

源文件

路径:wp-includes/post-template.php

<?php
...
function walk_page_tree( $pages, $depth, $current_page, $r ) {
	if ( empty($r['walker']) )
		$walker = new Walker_Page;
	else
		$walker = $r['walker'];
	foreach ( (array) $pages as $page ) {
		if ( $page->post_parent )
			$r['pages_with_children'][ $page->post_parent ] = true;
	}
	$args = array($pages, $depth, $r, $current_page);
	return call_user_func_array(array($walker, 'walk'), $args);
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/walk_page_tree/