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

You appear to be a bot. Output may be restricted

Description

Retrieve HTML list content for page list.

Usage

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

Parameters

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

Returns

string

Source

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

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

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

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

 View on GitHub View on Trac