wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



block_core_page_list_nest_pages › WordPress Function

Da5.8.0
Deprecaton/a
block_core_page_list_nest_pages ( $current_level, $children )
Parametri: (2)
  • (array) $current_level The level being iterated through.
    Richiesto:
  • (array) $children The children grouped by parent post ID.
    Richiesto:
Ritorna:
  • (array) The nested array of pages.
Definito a:
Codex:

Outputs nested array of pages



Sorgenti

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