wpseek.com
A WordPress-centric search engine for devs and theme authors



block_core_navigation_get_post_ids › WordPress Function

Since6.0.0
Deprecatedn/a
block_core_navigation_get_post_ids ( $inner_blocks )
Parameters:
  • (WP_Block_List) $inner_blocks Block list class instance.
    Required: Yes
Returns:
  • (array) Array of post IDs.
Defined at:
Codex:

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



Source

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 ) );
}