wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



block_core_navigation_block_contains_core_navigation › WordPress Function

Seit6.2.0
Veraltetn/v
block_core_navigation_block_contains_core_navigation ( $inner_blocks )
Parameter:
  • (WP_Block_List) $inner_blocks Inner block instance to be normalized.
    Erforderlich: Ja
Gibt zurück:
  • (bool) true if the navigation block contains a nested navigation block.
Definiert in:
Codex:

Returns true if the navigation block contains a nested navigation block.



Quellcode

function block_core_navigation_block_contains_core_navigation( $inner_blocks ) {
	foreach ( $inner_blocks as $block ) {
		if ( 'core/navigation' === $block->name ) {
			return true;
		}
		if ( $block->inner_blocks && block_core_navigation_block_contains_core_navigation( $block->inner_blocks ) ) {
			return true;
		}
	}

	return false;
}