WordPress.org

Make WordPress Core

Changeset 10230


Ignore:
Timestamp:
12/19/2008 08:27:11 PM (12 years ago)
Author:
ryan
Message:

Allow custom page walker classes. Props MikeLittle. fixes #8673

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r10150 r10230  
    720720 */
    721721function walk_page_tree($pages, $depth, $current_page, $r) {
    722     $walker = new Walker_Page;
     722    if ( empty($r['walker']) )
     723        $walker = new Walker_Page;
     724    else
     725        $walker = $r['walker'];
     726
    723727    $args = array($pages, $depth, $r, $current_page);
    724728    return call_user_func_array(array(&$walker, 'walk'), $args);
     
    733737 */
    734738function walk_page_dropdown_tree() {
    735     $walker = new Walker_PageDropdown;
    736739    $args = func_get_args();
     740    if ( empty($args[2]['walker']) ) // the user's options are the third parameter
     741        $walker = new Walker_PageDropdown;
     742    else
     743        $walker = $args[2]['walker'];
     744
    737745    return call_user_func_array(array(&$walker, 'walk'), $args);
    738746}
Note: See TracChangeset for help on using the changeset viewer.