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



block_core_page_list_nest_pages › WordPress Function

Seit5.8.0
Veraltetn/v
block_core_page_list_nest_pages ( $current_level, $children )
Parameter: (2)
  • (array) $current_level The level being iterated through.
    Erforderlich: Ja
  • (array) $children The children grouped by parent post ID.
    Erforderlich: Ja
Gibt zurück:
  • (array) The nested array of pages.
Definiert in:
Codex:

Outputs nested array of pages



Quellcode

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;
}