WordPress at Your Fingertips
function is not described

block_core_page_list_render_nested_page_list() WP 1.0

Outputs Page list markup from an array of pages with nested children.

No Hooks.

Return

String. List markup.

Usage

block_core_page_list_render_nested_page_list( $nested_pages );
$nested_pages(array) (required)
The array of nested pages.

Code of block_core_page_list_render_nested_page_list() WP 5.8.2

function block_core_page_list_render_nested_page_list( $nested_pages ) {
	if ( empty( $nested_pages ) ) {
		return;
	}
	$markup = '';
	foreach ( (array) $nested_pages as $page ) {
		$css_class = 'wp-block-pages-list__item';
		if ( isset( $page['children'] ) ) {
			$css_class .= ' has-child';
		}
		$markup .= '<li class="' . $css_class . '">';
		$markup .= '<a class="wp-block-pages-list__item__link" href="' . esc_url( $page['link'] ) . '">' . wp_kses(
			$page['title'],
			wp_kses_allowed_html( 'post' )
		) . '</a>';
		if ( isset( $page['children'] ) ) {
			$markup .= '<span class="wp-block-page-list__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>';
			$markup .= '<ul class="submenu-container">' . block_core_page_list_render_nested_page_list( $page['children'] ) . '</ul>';
		}
		$markup .= '</li>';
	}
	return $markup;
}