block_core_navigation_get_post_ids()
Iterate through all inner blocks recursively and get navigation link block's post IDs.
No Hooks.
Return
Array
. Array of post IDs.
Usage
block_core_navigation_get_post_ids( $inner_blocks );
- $inner_blocks(WP_Block_List) (required)
- Block list class instance.
block_core_navigation_get_post_ids() block core navigation get post ids code WP 6.5.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 ) ); }