walk_page_tree( array $pages, int $depth, int $current_page, array $args ): string

Retrieves HTML list content for page list.


Parameters

$pages array Required
$depth int Required
$current_page int Required
$args array Required

Top ↑

Return

string


Top ↑

Source

File: wp-includes/post-template.php. View all references

function walk_page_tree( $pages, $depth, $current_page, $args ) {
	if ( empty( $args['walker'] ) ) {
		$walker = new Walker_Page();
	} else {
		/**
		 * @var Walker $walker
		 */
		$walker = $args['walker'];
	}

	foreach ( (array) $pages as $page ) {
		if ( $page->post_parent ) {
			$args['pages_with_children'][ $page->post_parent ] = true;
		}
	}

	return $walker->walk( $pages, $depth, $args, $current_page );
}


Top ↑

Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.