walk_page_tree() – Retrieves HTML list content for page list.

You appear to be a bot. Output may be restricted

Description

Retrieves HTML list content for page list.

Usage

$string = walk_page_tree( $pages, $depth, $current_page, $args );

Parameters

$pages
( array ) required
$depth
( int ) required
$current_page
( int ) required
$args
( array ) required

Returns

string

Source

File name: wordpress/wp-includes/post-template.php


Lines:

1 to 20 of 20
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 );
}
 

 View on GitHub View on Trac