block_core_navigation_get_post_ids()WP 1.0

Iterate through all inner blocks recursively and get navigation link block's post IDs.

Хуков нет.

Возвращает

Массив. Array of post IDs.

Использование

block_core_navigation_get_post_ids( $inner_blocks );
$inner_blocks(WP_Block_List) (обязательный)
Block list class instance.

Код block_core_navigation_get_post_ids() WP 6.0.2

function block_core_navigation_get_post_ids( $inner_blocks ) {
	$post_ids = array_map( 'block_core_navigation_from_block_get_post_ids', iterator_to_array( $inner_blocks ) );
	return array_unique( array_merge( ...$post_ids ) );
}