Open ePascalC opened 7 years ago
reply_to added in v1.0.14
Hey man! Why aren't you commiting and closing in git for better history?
@renatonascalves I'm so used to svn on w.org, I have my test environment linked to trunk there, so I never invested time to look here how add GitHub in the loop of my current way of working. I just update the files when I have a new version but indeed there is no link between the specific Issue and the specific commit for it. Any help on how to proceed, not breaking too much my current way of working is accepted :-)
@ePascalC I can help with that! Gonna talk to you on Slack as this is not related to the issue here. :)
I'm thinking of starting up on threaded replies now. Have you looked at this idea recently? I may be able to use my own walker class to create a threaded API for topics/replies.
Hey @renatonascalves if you want a challenge try threaded replies here. The bbp api returns replies flat, not threaded. IF the replies were embedded within their parent, a walker or recursion could be used to make a threaded view. Otherwise there would have to be a ton of logic to make it happen, and paging won't work. I've started to look at this, but not sure I can/want to dedicate the time to do it right now.
@tkserver Let me see if I get this correctly. You have a topic. This topic has replies. And some of those replies have other replies in it. You want to fetch the replies and their replies in it.
Something like this:
{
"id": 8523,
"title": "Responder a: Never let me down",
"permalink": "http://b.dev/sala/resposta/8523/",
"topic_id": 7612,
"topic_title": "Never let me down",
"forum_id": 6153,
"tags": "",
"content": "<p>Thanks! 😀</p>\n",
"reply_to": "id of reply or list of ids with replies"
}
By the way, I think wp-json/bbp-api/v1/replies/
is not working correctly. It's not returning the replies even though there are replies to return.
I still need to confirm that.
Have a look at this home page to see how the threading would work: https://www.utehub.com
I hacked up the bbpress walker to create this.
I tried here: https://www.utehub.com/wp-json/bbp-api/v1/replies/
Nothing! Am I getting in the wrong slug/namespace?
I don't use the replies endpoint since replies are embedded in the topics. But I think the way it works is replies to replies: https://www.utehub.com/wp-json/bbp-api/v1/replies/41220
Have you looked at how the posts and replies look on the www version I posted?
In the front-page of your website there is a reply: 412010.
I don't the replies of the replies in the output. :/
Yeah, it only seems to be replies to replies.
Currently all replies come in a flat list. Check out the bbp_walker_reply to have the threaded list to see the replies to replies in a structured way.
As a first, add the 'reply_to' in the JSON output.