Download the PHP package thebbapp/rest-api-bbpress without Composer
On this page you can find all versions of the php package thebbapp/rest-api-bbpress. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thebbapp/rest-api-bbpress
More information about thebbapp/rest-api-bbpress
Files in thebbapp/rest-api-bbpress
Package rest-api-bbpress
Short Description BBPress REST API implementation for BbApp.
License AGPL-3.0-or-later
Informations about the package rest-api-bbpress
thebbapp/rest-api-bbpress
BBPress REST API implementation for BbApp. The library can be used independently of the full BbApp framework stack, making it reusable for any WordPress site that needs BBPress REST API functionality.
Simplified Dependency Tree
Installation
Install via Composer:
Requirements
- PHP >= 7.2.24
- WordPress with BBPress plugin installed and activated
thebbapp/rest-api-wordpress-base>= 0.1.0
Usage
This library extends the WordPress REST API to provide comprehensive BBPress forum, topic, and reply functionality. It adds REST endpoints, custom fields, meta queries, and anonymous posting support for BBPress.
Basic Setup
Initialize and register the BBPress REST API in your WordPress plugin or theme:
What This Library Provides
1. REST API Endpoints for BBPress
The library automatically enables REST API support for BBPress post types:
- Forums:
/wp/v2/forums - Topics:
/wp/v2/topics - Replies:
/wp/v2/replies
All endpoints support standard WordPress REST API operations (GET, POST, PUT, DELETE) with batch support.
2. Custom REST Fields
The library adds several computed and meta fields to BBPress resources:
For Forums:
menu_order- Menu order
For Forums, Topics:
_bbp_last_active_time- UNIX timestamp of last activityparent- Parent post ID
For Topics:
_bbp_reply_count- Number of replies in the topic_bbp_forum_id- The forum ID (in meta)
For Replies:
_bbp_reply_count- Number of replies to this reply (nested replies)_bbp_reply_to- Parent reply ID
For Anonymous Posts (when bbp_allow_anonymous() returns true):
_bbp_anonymous_name- Anonymous author name
3. Enhanced Query Parameters
The library extends collection endpoints with BBPress-specific query parameters:
Parent Filtering:
Meta Queries:
Ordering by BBPress Fields:
4. Anonymous Posting Support
When BBPress anonymous posting is enabled (bbp_allow_anonymous() returns true), the library:
- Allows unauthenticated POST requests to
/wp/v2/topicsand/wp/v2/replies - Accepts anonymous author name and email via meta fields
- Allows anonymous comments on topics and replies
5. BBPress Handler Integration
The library uses BBPress's native handlers for creating and updating topics and replies, ensuring:
- Proper validation and sanitization
- BBPress hooks and filters are triggered
- Forum statistics are updated correctly
- Subscriptions and notifications work as expected
Advanced Usage
Extending the Library
You can extend BbPressRESTAPI to add additional functionality: