Short of building it yourself, you don’t. WordPress doesn’t have a way to get a nested array of comments like that. Instead, it gets all the comments to be displayed, then uses a class called a “walker” to display them.
The Walker_Comment class is built on top of the generic Walker class. The Walker class implements the logic for traversing the array and using the parent field to determine the nesting, the Walker_Comment class implements the display characteristics, such as putting them into the proper HTML list items and such.
Related Posts:
- Get comment content by comment ID
- Threaded commenting: how to show threads by last active first?
- How to create a link to jump to “Leave a comment” part?
- Check if someone recently commented in one of my posts
- Sort/list/arrange comments by comment author in un-nested/no thread comments
- Change id=”respond” to the comments container
- How can i change the order of comments?
- Random output of comments using a shortcode
- Order comments in admin by custom date
- orderby not working for query_posts using array of IDs
- Comments screen in backend, how to disable email address of commenter for non admins
- How can I limit the number of comments per registered user per day?
- Parent comment’s author name
- get_comments_number of depth-1 (Level 1) (1 post)
- How can I control the comment counts filtering my CPT replies?
- How to auto-approve internal pingbacks?
- Can I store my custom comment_type into wp_comments table?
- Number of External Links in Comments – Moderation Option
- What is comment_karma?
- How to override function twentyten_comment
- Disqus over the default commenting engine, what are some pros and cons?
- How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form
- Plugin from WordPress.com for comment notification…available? [closed]
- How to add text to comment form #content textarea?
- Enable Recent Comments widget to display comments on attachment posts
- Change allowed HTML tags for comments
- How can I highlight admin comments?
- Why are my comments closed?
- On WordPress 4.4, how to get the post id using the comment_post hook
- Block comments from search engine indexing
- Create a “Reject” action for comments?
- Add action on delete comments?
- Exclude child comments in get_comments() or WP_Comment_Query?
- Changing “submitted on date” of comments
- Filter custom comment type from Manage Comments & Dash Widgets
- How to check the array of featured images IDs
- Can’t seem to get this CSS to work…any ideas why? [closed]
- Change order of comment fields
- WordPress custom form action url
- How to add a strip of visual editor on top of comments textarea
- Threaded comments not working
- Customizing comments pagination for bootstrap
- comment_post action hook running on page load instead of after a comment is posted
- woocommerce allow users to select or use avatar
- How to sort posts by the average of comment meta values
- Error While Sending Comment
- Problem with Comment link in Blog [closed]
- Commenting in user profile page?
- Can i Use own Facebook App ID with this Social Comment Plugin? [closed]
- How do i hide all comments from logged out users
- Only allow the post author and admin to comment on a post
- Show Social Sharing Buttons And Facebook Comments In Lightbox Modal Dialog (Image Overlay)?
- Grant a person permission to moderate all comments on a blog without giving them the ability to edit other peoples post
- How come pending comments are appearing in admin?
- Generate Sub-Comments with WP-CLI [closed]
- comment_date() & comment_time() not working from functions.php
- Repositioning ‘Reply’ Link in Comments
- Add an attachment feature to comments
- Counting Comments as Singular and Plural in comments.php Template
- How to display custom comment fields onto any page
- How to get Post title by locale with Qtranslate-X
- Retrieve the last 5 comment URLs
- WordPress comment for virtual page
- Admin Dashboard – Recent Comments source
- After submit comments select the current tab
- Genesis Child Theme Modifying Comments display
- Hide Trackbacks/Pingbaks if none exists
- How to use filter on comment submission/insert
- It doesn’t matter if I have more than one comment. get_comments_number still equal to one?
- Simple spam check for valid domain in commenter’s email address
- Allowing WordPress.org/com accounts on a self-hosted install
- How to remove the “comments” bit that appears next to or below the posts
- Post comments don’t show
- Get all comments associated with a specific page ID (comment_post_ID)
- Update post “A” on comment submition on post “B”
- How do I add custom field to Admin comment form and display
- I would like to count number of comments after 5 days ago
- Comments counter only for Authors Posts
- Pre- Approved Comment Capability
- Delete comments function
- Comment form not working
- Necessary to have a comments.php if there are no comments?
- Inserting comments via a procedure
- transition_comment_status gets called when untrashing comments
- spacebar is not working in input and textarea
- wp-editor-area textarea disapear on cancel-comment-reply-link click
- Conditionally process comments while ignoring replies
- Required Field for Comment parent only?
- WordPress is adding above html
- Passing user meta through comment form
- How do I separate author avatars and comments in 3.4.2?
- writing a plugin, how to disable the comment form altogether?
- How do I convert users who put an email and username for a comment into registered users? [duplicate]
- What filter or action to replace comments or add new comment system
- How to stop a specific person to comment on my blog? [closed]
- Auto delete WordPress comments
- Query comments with non-empty ‘author_url’ value on Admin Comments Screen
- Customize the new comment notifications sent to the post author after the comment is approved
- Get approved comments or comments that the author is me
- Show/Hide comments