Forum Replies Created
-
In reply to: Is there an API for bbPress
Hi @tkserver, sorry for my silence but in these days I’m a bit swamped with preparing to move back home after some time living and working abroad.
I’m not sure what you mean by where’s my git repo; do you mean this?https://github.com/mapofemergence/BB-REST
I believe it’s linked in my previous post and I see you have starred it, so I might have misunderstood the question. In that case, please expand a bit more 🙂BTW, in less than one week I’ll be back home so I should be a bit more responsive in replying.
Sorry again,
s t eIn reply to: Is there an API for bbPress@tkserver, @casiepa glad to read you’re keeping up with the good work.
I’m a bit swamped in these days, wrapping up my experience overseas and having to move back to the old continent next week.
I’ll have a better look at the latest additions in Pascal’s repo and its fork by @tkserver.I’m looking forward to see how that all evolves and I’ll be more than happy to contribute, as soon as I’ll have some time.
I’d just love to find some space to discuss about the design aspects of the API too, before diving too much into writing code and risk to bump into limitations late in the process.I keep reading you with great interest.
Cheers,
s t eIn reply to: Is there an API for bbPress@tkserver please do keep me/us posted about your progress.
I’m not familiar with Angular JS, at all, but I’ve invested quite some thoughts on the frontend too; my implementation is a basic and quite old-school combo of PHP and AJAX jQuery but, still, that doesn’t mean I’m not aiming at a smart and fresh UX 🙂
I’m very interested in hearing other people’s thoughts, both with regards to usage philosophy and in terms of code implementation. I firmly believe that’s the best (possibly the only) way to make the right choices, early in the development, for the backend to be generalized and robust enough to serve everybody’s requirements.
In reply to: Is there an API for bbPressHi @TKServer, I’m glad you revamped this topic.
Although since my last post I didn’t work further on the code, I’m still very much interested in the discussion.
Originally, I was going in the same direction that you just suggested but, ultimately, I thought that a separate API would be desirable for a variety of reasons.I can name the ones I thought of, but I’m sure others might have even stronger (and more educated) motivations:
- the most general and obvious: a separate API makes you less dependant on certain builtin constraints of WP API and let you take design decision which are more tightly connected with bbPress specifically; even though bbPress leverages WP’s custom post types and tags, there’s a higher layer of abtraction (read: forum functionality) which implies a whole set of requests for which the existing endpoints’ structure is not ideal
- depending on what info you want to get with a single request, the default WP API queries might not serve the scope well (ie. they could force the user to make multiple queries where just one would be desirable and sufficient; also, where multiple database calls are required, it might not provide those in the best performing way)
- from a user standpoint, I believe it is better to offer schemas (and filters) which reflect more the semantics of a forum, than the ones of a blog; I believe you can still build those custom terms in the existing API, but it might become confusing soon, and in my opinion you’d loose the advantage of staying with a single API, anyway
- additionally (and actually the main reason for me personally), I see bbPress as part of an ecosystem, with WP and BuddyPress. Since BuddyPress already went for a separate API, I thought it would make sense to do the same with bbPress, keeping things clean and separate. Utlimately, the ideal would be to have the bbPress API live with the bbPress plugin itself, so that the development of the two can progress together (and therefore be more efficient and optimised, both ways)
- finally, speaking of bbPress BuddyPress, there’s an area where the two plugins overlap (bb forums in BP groups); I believe it is already a non-trivial problem to solve in a separate API and it would likely be even more complicated to try and stay within the WP limits; I was mentioning this in another post too, which I believe is still awaiting approval from moderators (please pardon me if I dare poking them here, once more) 🙂
Again, this is just my opinion; there are probably pros and cons in both options and I’d be more than happy to hear from anyone who’s more bbPress-savvy than I am.
Cheers,
s t eIn reply to: Is there an API for bbPressHi there,
while waiting for the github by @casiepa to be updated, I managed to take some time to (partially) clean what I had written so far.
I published it on a repo, just in case anybody were interested in taking a look and opening a discussion about desirable ways to approach the problem and to structure the code.Here it is:
https://github.com/mapofemergence/BB-RESTcheers,
s t eIn reply to: Is there an API for bbPress@jpvanmuijen I started looking at how bbPress works under the hood just recently, so I’m learning these things just by looking into the code and trying to guess. I’m glad I didn’t give a wrong hint 🙂
I’m not sure if there’s any higher-level logic wrapping this in bbPress functions, though; any experienced bbPress guy is more than welcome to expand on this: I’d be happy to know if there’s a better way.
Hopefully, with the REST API this sort of tasks will become pretty straight forward 🙂
In reply to: Is there an API for bbPress@jpvanmuijen
Assuming $single_item[‘id’] contains the id of the reply, this should do what you want:
$topic_id = get_post( $single_item[‘id’] )->post_parent;
In reply to: Is there an API for bbPressHi everybody,
I was actually starting a topic about this, a few days ago, but my post contains a bunch of links (more than 3) to help contextualize the discussion and it’s still pending approval.
If moderators can help with that, the link to the topic is:
https://bbpress.org/?post_type=topic&p=181440
(I hope it’s not a problem to link it here; in case, feel free to delete or edit this reply)I was trying to start writing a first version of a REST API too, as I missed the latest posts by Pascal. Also, I looked for existing code here:
https://github.com/ePascalC/bbp-API
but found only empty files. Am I missing something?Anyway, I downladed the plugin and checked the code there.
Mine differs a bit as I was using BP-REST as a starter: I saw they had an extensive discussion about how to frame the whole work and structure it for the longer term, so I thought it was a good idea to take that into consideration.If you think we might join efforts on this, let me know; I have limited time to invest on this but I’d be pleased to give my contribution whenever I can.
Cheers,
s t e