block_core_navigation_from_block_get_post_ids() – Get post IDs from a navigation link block instance.
You appear to be a bot. Output may be restricted
Description
Get post IDs from a navigation link block instance.
Usage
$array = block_core_navigation_from_block_get_post_ids( $block );
Parameters
- $block
- ( WP_Block ) required – Instance of a block.
Returns
array Array of post IDs.
Source
File name: wordpress/wp-includes/blocks/navigation.php
Lines:
1 to 15 of 15
function block_core_navigation_from_block_get_post_ids( $block ) { $post_ids = array(); if ( $block->inner_blocks ) { $post_ids = block_core_navigation_get_post_ids( $block->inner_blocks ); } if ( 'core/navigation-link' === $block->name || 'core/navigation-submenu' === $block->name ) { if ( $block->attributes && isset( $block->attributes['kind'] ) && 'post-type' === $block->attributes['kind'] && isset( $block->attributes['id'] ) ) { $post_ids[] = $block->attributes['id']; } } return $post_ids; }