WordPress.org

Make WordPress Core

Ticket #11338: walker_patch.diff

File walker_patch.diff, 1.8 KB (added by ShaneF, 8 years ago)

added Walker_Comment fix

  • category-template.php

     
    722722        if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
    723723                $walker = new Walker_Category;
    724724        else
    725                 $walker = $args[2]['walker'];
     725                $walker = new $args[2]['walker'];
    726726
    727727        return call_user_func_array(array( &$walker, 'walk' ), $args );
    728728}
     
    740740        if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
    741741                $walker = new Walker_CategoryDropdown;
    742742        else
    743                 $walker = $args[2]['walker'];
     743                $walker = new $args[2]['walker'];
    744744
    745745        return call_user_func_array(array( &$walker, 'walk' ), $args );
    746746}
  • comment-template.php

     
    13891389
    13901390        if ( empty($walker) )
    13911391                $walker = new Walker_Comment;
     1392        else
     1393                $walker = new $walker;
    13921394
    13931395        $walker->paged_walk($_comments, $max_depth, $page, $per_page, $r);
    13941396        $wp_query->max_num_comment_pages = $walker->max_pages;
  • post-template.php

     
    859859        if ( empty($r['walker']) )
    860860                $walker = new Walker_Page;
    861861        else
    862                 $walker = $r['walker'];
     862                $walker = new $r['walker'];
    863863
    864864        $args = array($pages, $depth, $r, $current_page);
    865865        return call_user_func_array(array(&$walker, 'walk'), $args);
     
    877877        if ( empty($args[2]['walker']) ) // the user's options are the third parameter
    878878                $walker = new Walker_PageDropdown;
    879879        else
    880                 $walker = $args[2]['walker'];
     880                $walker = new $args[2]['walker'];
    881881
    882882        return call_user_func_array(array(&$walker, 'walk'), $args);
    883883}