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
- Understanding WordPress functions’ naming conventions
- How to add multiple custom URL variables?
- How can I change the frequency of a scheduled event?
- When is it appropriate to put functions on page template vs. functions.php?
- How can i list current author’s categories?
- 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()
- Plugin development: is adding empty index.php files necessary?
- Undefined function wp_set_password
- Comment `Reply` link doesn’t work if comments are loaded from ajax
- comment_email hook doesn’t seem to work for comment editor field
- Show comments fields in two columns
- Plugin Uninstall and Deactivate via Options Menu
- How can I add a CSS rule to edit.php?
- 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
- 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
- is user logged in not working
- Comments do not respect display_name setting, how to make plugin to overcome this
- Override class inside $atts shortcode_atts in WordPress
- add_rewrite_rule works in themes function php but when moved into plugin it stops working
- 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?
- correct way to call javascript into hook function
- Append varible to url or set session
- how to search users by ajax live search
- Remove unwanted elements for a wp_nav_menu
- How to add user details to different tables immediately after user registration
- mysql_real_escape_string() vs. esc_sql() in WordPress
- Checking for existence of a page by title?
- WordPress class, using add_action to call member function does not work
- wp_get_theme Warning: Illegal offset type
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Print Dashboard submenu name and filename
- Autogenerate a Table of Contents
- How to replace default comments with custom HTML?
- Custom avatars in wordpress comments?
- Apply styles to blockquote element with the WYSIWYG editor
- Call to undefined function is_home() or any conditional tags
- how to load the comment template from a plugin
- How to output functions from plugin inside theme
- How can I programmatically change a MySql variable (foreign_keys_check)?
- wp_schedule_event is registered but function isn’t running
- Is it advisable to use $post->comment_count instead of get_comments_number( $post_id )
- How to get the number of pages when paginating comments?
- how to get the top 10 popular blogs
- Remove Permalink Meta Box not working?
- Setting post_id for single.php based on URL without a redirect
- disable defaault wordpress comments from a plugin
- using admin functions on frontend
- Javascript Function Called Too Early in PHP Script
- Modify code for functions.php with specific twitter user url and hashtags
- can’t access some WordPress function from my plugin
- WP 3-way voting system: On to something! Please help!
- Customise Grouped Product display in Woocommerce with custom column
- Change the behaviour of a button
- How to show comments from different Plugins to same post type?
- How to get the `comment_post_ID`?
- Can someone explain what’s the use of parse request function in WordPress?
- Add default value from selection
- Override category archive page title (not the head title)
- Redirection from a specific page for users logged in but not with membership
- how to create a shortcode from a variable in plugin
- Why would one specify multiple arguments when using get_previous_posts_link() which takes only one parameter?
- I cant add is_admin control to plugin
- Email content as comment
- Remove tag from all posts when publishing new post
- 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
- 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
- Get Commentor IP When Marking Comment As Spam
- How can I add recent posts to menu like mashable
- Why is ‘register_activation_hook’ undefined?
- Custom options page for themes
- Call do_action() within WordPress cronjob
- get_term_by() returning null on plugin
- How to assign to each output values from foreach loop to a meta_key?