wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



walk_page_tree › WordPress Function

Od2.1.0
Przestarzałyn/a
walk_page_tree ( $pages, $depth, $current_page, $args )
Parametry: (4)
  • (array) $pages
    Wymagane: Tak
  • (int) $depth
    Wymagane: Tak
  • (int) $current_page
    Wymagane: Tak
  • (array) $args
    Wymagane: Tak
Użytkowanie:
  • Walker_Page
Powrót:
  • (string)
Zdefiniowane na:
Codex:

Retrieves HTML list content for page list.



Źródło

function walk_page_tree( $pages, $depth, $current_page, $args ) {
	if ( empty( $args['walker'] ) ) {
		$walker = new Walker_Page();
	} else {
		/**
		 * @var Walker $walker
		 */
		$walker = $args['walker'];
	}

	foreach ( (array) $pages as $page ) {
		if ( $page->post_parent ) {
			$args['pages_with_children'][ $page->post_parent ] = true;
		}
	}

	return $walker->walk( $pages, $depth, $args, $current_page );
}