[wp-trac] [WordPress Trac] #10948: wp_list_comments() always assumes walker will echo.

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 13 12:21:34 UTC 2009


#10948: wp_list_comments() always assumes walker will echo.
--------------------------+-------------------------------------------------
 Reporter:  MikeLittle    |       Owner:           
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  2.9      
Component:  Comments      |     Version:  2.8.4    
 Severity:  normal        |    Keywords:  has_patch
--------------------------+-------------------------------------------------
 wp_list_comments() always assumes the walker called will echo it's
 constructed content (the default Walker does this).

 However, if you want to use your own walker which doesn't echo, or you
 want to post process the output of the default walker in some way, you
 cannot.

 The changes required are to wp_list_comments() which should check for an
 'echo' arg and respond appropriately (like wp_list_pages does). The built
 in comment walker class Walker_Comment needs to write it's output to the
 passed $output reference. Finally the function edit_comment_link() needs
 to take an echo parameter.

 The attached patch allows this functionality whilst preserving the status
 quo by adding a default echo => 1 argument to wp_list_comments and
 edit_comment_link.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10948>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list