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



block_core_page_list_nest_pages › WordPress Function

Depuisn/a
Dépréciéen/a
block_core_page_list_nest_pages ( $current_level, $children )
Paramètres: (2)
  • (array) $current_level The level being iterated through.
    Requis: Oui
  • (array) $children The children grouped by parent post ID.
    Requis: Oui
Retourne:
  • (array) The nested array of pages.
Défini(e) dans:
Codex:

Outputs nested array of pages



Source

function block_core_page_list_nest_pages( $current_level, $children ) {
	if ( empty( $current_level ) ) {
		return;
	}
	foreach ( (array) $current_level as $key => $current ) {
		if ( isset( $children[ $key ] ) ) {
			$current_level[ $key ]['children'] = block_core_page_list_nest_pages( $children[ $key ], $children );
		}
	}
	return $current_level;
}