wp_list_comments() always assumes walker will echo.
|Reported by:||MikeLittle||Owned by:||nacin|
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.
Change History (33)
- Keywords needs-patch added; has-patch early removed
- Milestone changed from Awaiting Triage to Future Release
- Milestone changed from 3.7 to Future Release
- Type changed from defect (bug) to enhancement