In the default usage this is impossible due to the nature of the default comment walker which always directly outputs. But the function allows to provide a custom walker.
Further reading about custom walkers:
Codex Class reference
example custom walker class
You could also use output buffering to save it into a variable (this is considered to be dirty):
ob_start();
wp_list_comments(array('reverse_top_level' => false ), $comments);
$variable = ob_get_clean();
Related Posts:
- How can I see a varibles value when my plugin runs?
- How to include PHP files in plugins the correct way
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- Why does WordPress add 0 (zero) to an Ajax response?
- Passing arguments to a admin menu page callback?
- function deactivate_plugins does not exist
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Understanding WordPress functions’ naming conventions
- How to add multiple custom URL variables?
- Using OOP plugin’s methods throughout the website
- Writing a plugin that notify my friends of new post that mentions(@) them
- function triggered by “manage_users_custom_column” filter not working
- How can I change the frequency of a scheduled event?
- WordPress plugin how to run function when button is clicked
- When is it appropriate to put functions on page template vs. functions.php?
- Shortcodes, output buffering, and WordPress functions
- How can i list current author’s categories?
- Determine which theme location a wp_get_nav_menu_items is for
- When to check if a function exists
- Checking for existence of a page by title?
- Why are two functions over-riding each other?
- Dynamically Override Fancy Title
- Problems with removing admin bar
- Problem with `wp_mail()`
- Calling a function from functions.php in custom page/ blog post
- Check if I am in the Admin Panel (wp-admin)?
- What is the Difference between directly call a function and call a function using add_action?
- Call to undefined function get_blog_option()
- Use of global variables within plugin [closed]
- What is the difference between current_page_parent and current_page_ancestor?
- Plugin development: is adding empty index.php files necessary?
- Undefined function wp_set_password
- Does add_filter work outside functions.php
- What function to hook for changes made in status and visibility of a post
- Comment `Reply` link doesn’t work if comments are loaded from ajax
- comment_email hook doesn’t seem to work for comment editor field
- how to use preg_replace for wordpress video?
- Show comments fields in two columns
- Plugin Uninstall and Deactivate via Options Menu
- How can I add a CSS rule to edit.php?
- wp_enqueue_script + wp_enqueue_style Since When
- preprocess_comment array doesn’t have comment_ID
- How to get variables from fucntion.php to my plugin files
- Widget update function not saving values
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- add more custom post types and custom role to the code
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- How to use WP_Term with (menu) argument in the wp_nav_menu?
- WordPress after content Hook & external template part
- Enqueue scripts in footer
- override pluggable.php functions
- Retrieve contents/page names of various pages for use in a plugin
- is user logged in not working
- Can I change header.php of current theme through a plugin function?
- Comments do not respect display_name setting, how to make plugin to overcome this
- get_current_screen() return null
- Override class inside $atts shortcode_atts in WordPress
- creating custom function to log actions in plugin
- add_rewrite_rule works in themes function php but when moved into plugin it stops working
- Maximum lifetime for nonce
- How to fix Uninitialized string offset: error on a checkbox in WP Settings API
- Where can i find wordpress auto update code flows?
- $reverse_top_level works the opposite way according to Codex?
- Adding option to Gallery shortcode
- correct way to call javascript into hook function
- How to integrate CLEditor to comment system?
- Append varible to url or set session
- How to change the hover content of a specific menu item on WordPress?
- how to search users by ajax live search
- Remove unwanted elements for a wp_nav_menu
- How do I update a field of a meta box?
- Get attachments from a post
- Email content as comment
- Remove tag from all posts when publishing new post
- WordPress plugin how to run function when button is clicked
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Add function to Dokan ajax class
- foreach argument to get specific file types getting too many returns
- Remove from a div by class name from post page if post author role is not administrator
- Function not working on any file other than the main plugin file
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- Ajax not working to insert, query and result data
- Stop theme displaying comments
- Template file structure , wordpress hook for altering the template
- WordPress permalink setting
- Get Commentor IP When Marking Comment As Spam
- How can I add recent posts to menu like mashable
- Why is ‘register_activation_hook’ undefined?
- How to add chunk of php, html, and sql code to variable an append to $content
- Dynamic banner for use on external sites
- How can i call from custom fields to the category editor?
- Custom options page for themes
- Why does this fail: Disabling plugins enqueue_script() in functions.php
- Call do_action() within WordPress cronjob
- isset($_POST[‘submit’]) ignored on comment submission
- How to plugin function code move to theme function.php ? I’ve tried below code but not working [closed]
- WordPress simple ‘Hello World’ plugin – problems
- get_term_by() returning null on plugin
- Sticky bar with filter button and product count
- How to assign to each output values from foreach loop to a meta_key?