Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/26/2017 08:15:20 AM (8 years ago)
Author:
johnjamesjacoby
Message:

Replies: Ensure hierarchical replies are correctly wrapped & concatenated into their output buffers in the correct order.

This updates the walker class to not immediately echo it's contents, and wraps it in an ul element.

Fixes #2757. See #2830.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/functions.php

    r6310 r6317  
    25392539function bbp_list_replies( $args = array() ) {
    25402540
     2541    // Get bbPress
     2542    $bbp = bbpress();
     2543
    25412544    // Reset the reply depth
    2542     bbpress()->reply_query->reply_depth = 0;
     2545    $bbp->reply_query->reply_depth = 0;
    25432546
    25442547    // In reply loop
    2545     bbpress()->reply_query->in_the_loop = true;
    2546 
     2548    $bbp->reply_query->in_the_loop = true;
     2549
     2550    // Parse arguments
    25472551    $r = bbp_parse_args( $args, array(
    2548         'walker'       => null,
     2552        'walker'       => new BBP_Walker_Reply,
    25492553        'max_depth'    => bbp_thread_replies_depth(),
    25502554        'style'        => 'ul',
     
    25562560
    25572561    // Get replies to loop through in $_replies
    2558     $walker = new BBP_Walker_Reply;
    2559     $walker->paged_walk( bbpress()->reply_query->posts, $r['max_depth'], $r['page'], $r['per_page'], $r );
    2560 
    2561     bbpress()->max_num_pages            = $walker->max_pages;
    2562     bbpress()->reply_query->in_the_loop = false;
     2562    echo '<ul>' . $r['walker']->paged_walk( $bbp->reply_query->posts, $r['max_depth'], $r['page'], $r['per_page'], $r ) . '</ul>';
     2563
     2564    $bbp->max_num_pages            = $r['walker']->max_pages;
     2565    $bbp->reply_query->in_the_loop = false;
    25632566}
    25642567
Note: See TracChangeset for help on using the changeset viewer.