Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#44555 closed enhancement (duplicate)

Add hierarchical parameter to comments endpoint

Reported by: brgweb's profile brgweb Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.6
Component: REST API Keywords:
Focuses: Cc:

Description

I have a performance problem usign REST API to show threaded comments. Right now I need to make a GET request for each comment and then another GET for each of its children. I'd like to make just one GET and receive all the comments threaded as a multidimensional array (or object).

The WP Comment Query Class already implements "hierarchical" paramenter in its constructor. If this parameter is set to 1, or threaded", the comments are organized in a multidimensional array. It would be nice if we could add this parameter to REST API too.

Change History (3)

#1 @birgire
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the ticket @brgweb

This seems to be a duplicate of #41821 though.

#2 @kadamwhite
6 years ago

A duplicate indeed, but definite thanks to you @brgweb for adding your voice to the issue. This is something we've been talking about for some time, but hasn't had a champion to take it forward. If you have the bandwidth, I'd welcome your thoughts on #41821 -- or a patch, should you have a good idea about a solution, though I wouldn't want to presume :) We can continue the discussion over there.

Thanks for the bug gardenin, @birgire!

#3 @brgweb
6 years ago

Yes, it's a duplicate. I will move on to #41821. Since it's a feature I will develop anyway, I can work on that ticket, instead of creating a custom endpoint. Thanks @kadamwhite and @birgire!

Note: See TracTickets for help on using tickets.