There are a couple of queries I’ve found are necessary for posts. First is the standard query which posts to the wp_posts and the second posts to wp_postmeta. They’re very dependent on other functions within bbpress. It’s a bit of a can of worms in my experience. You could create a set of custom queries to do both of these, or try to use all of bbpress’s queries and functionality. Either way, it is not simple.
Hey TK, thanks for the reply. That’s a helpful for me to get started.
Where’s a good place to look into the bbpress functions that are tied in with these wp functions?
Also, are the posts in bbpress a custom post type like any other or is there more to it than that?
Thanks again!
Hi,
posts are just custom post types (topic, reply) and have metadata attached. bbPress is following standard WordPress rules in the database.
For bbPress functions and filters, I normally end up on http://hookr.io/plugins/bbpress/2.5.6/functions/
Pascal.
You can look at the functions.php files inside of topics and replies. They’ll give you some idea.
I’ve just made live my beta page of a threaded view with new posts and new replies able to be posted outside of bbpress here: http://www.utehub.com/forum-threads/
It’s beta, so lots to work on.
TK, I’ve already extended an existing plugin of mine to post regular wordpress posts to the website using the wp_insert_post function. Is that the same function I need be using to post to bbpress, just with additional metadata?
Hi Trent,
For bbPress: both a topic and a reply are inserted in the ‘posts’ table. The thing that mainly changes is the ‘post_type’. Then the meta data (dates, parents, …) go into the ‘post_meta’ table. So the global idea is exactely like posts, yes.
Pascal.
Thanks for the clarification. At this point I feel pretty lost though, as I’ve never actually had to add functionality to WordPress.
Do you know of any working examples or tutorials that show how to post a topic from an external app or client?
I just finished all this. Total pain. I had to reverse engineer the DB posts, then look at the bbpress functions to see what ones I could use, or simply which queries etc I could utilize.
Look in includes/topics/functions.php and includes/replies/functions.php for most of what you will need.