Version: 1.0
Author: Drew Winkles
Description: This plugin provides a simple REST API for bbPress, enabling you to retrieve bbPress forums, topics, and replies via the WordPress REST API.
This plugin exposes three endpoints for fetching bbPress data:
- Forums: Retrieve all forums created within bbPress.
- Topics: Fetch all topics within a bbPress forum.
- Replies: Access all replies associated with bbPress topics.
The following REST API routes are registered:
-
Get all forums
Endpoint:/wp-json/bbpress/v1/forums
Method:GET
Response: Returns a list of all bbPress forums. -
Get all topics
Endpoint:/wp-json/bbpress/v1/topics
Method:GET
Response: Returns a list of all bbPress topics. -
Get all replies
Endpoint:/wp-json/bbpress/v1/replies
Method:GET
Response: Returns a list of all bbPress replies.
- Upload the
bbpress-rest-apifolder to your/wp-content/plugins/directory. - Activate the plugin through the 'Plugins' menu in WordPress.
- Ensure bbPress is installed and activated since this plugin relies on bbPress post types (
forum,topic,reply).
Once activated, you can access the bbPress REST API endpoints by navigating to the URLs based on your WordPress installation:
<your-site-url>/wp-json/bbpress/v1/forums
<your-site-url>/wp-json/bbpress/v1/topics
<your-site-url>/wp-json/bbpress/v1/repliesTo fetch all bbPress topics, you can send a GET request to the following URL:
GET <your-site-url>/wp-json/bbpress/v1/topics[
{
"ID": 1,
"post_title": "First Topic",
"post_content": "This is the content of the first topic.",
...
},
{
"ID": 2,
"post_title": "Second Topic",
"post_content": "This is the content of the second topic.",
...
}
]- You can modify the
posts_per_pageargument in each of theget_forums(),get_topics(), orget_replies()functions to limit the number of items returned. - Use additional WP_Query arguments to customize the data retrieval as per your needs.
This plugin is open-source and available under the GPL-2.0 License.
1.0
- Initial release of the plugin.