wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



block_core_navigation_get_inner_blocks_from_unstable_location › WordPress Function

Depuisn/a
Dépréciéen/a
block_core_navigation_get_inner_blocks_from_unstable_location ( $attributes )
Paramètres:
  • (array) $attributes The block attributes.
    Requis: Oui
Retourne:
  • (WP_Block_List) Returns the inner blocks for the navigation block.
Défini(e) dans:
Codex:

Gets the inner blocks for the navigation block from the unstable location attribute.



Source

function block_core_navigation_get_inner_blocks_from_unstable_location( $attributes ) {
		$menu_items = block_core_navigation_get_menu_items_at_location( $attributes['__unstableLocation'] );
		if ( empty( $menu_items ) ) {
			return new WP_Block_List( array(), $attributes );
		}

		$menu_items_by_parent_id = block_core_navigation_sort_menu_items_by_parent_id( $menu_items );
		$parsed_blocks           = block_core_navigation_parse_blocks_from_menu_items( $menu_items_by_parent_id[0], $menu_items_by_parent_id );
		return new WP_Block_List( $parsed_blocks, $attributes );
	}
}