REST API
Base: /wp-json/oforum/v1/
| Method | Endpoint | Auth | Description |
| GET | /rooms | Public | List all public rooms |
| GET | /rooms/{id}/threads | Public | Paginated thread list for a room |
| POST | /threads | WP auth | Create a new thread |
| GET | /threads/{id} | Public | Thread details |
| PATCH | /threads/{id} | Author/Mod | Update thread (title, close, sticky) |
| DELETE | /threads/{id} | Author/Mod | Delete thread |
| GET | /threads/{id}/replies | Public | Paginated replies |
| POST | /threads/{id}/replies | WP auth | Post a reply |
| PATCH | /replies/{id} | Author/Mod | Edit a reply |
| DELETE | /replies/{id} | Author/Mod | Delete a reply |
| POST | /replies/{id}/react | WP auth | Toggle emoji reaction |
| GET | /search | Public | Full-text search |
Action Hooks
phpadd_action( 'of_thread_created', function( int $thread_id, int $room_id, int $user_id ) {} );
add_action( 'of_reply_posted', function( int $reply_id, int $thread_id, int $user_id ) {} );
add_action( 'of_thread_solved', function( int $thread_id, int $reply_id ) {} );
add_action( 'of_user_banned', function( int $user_id, string $type, int $mod_id ) {} );
Filter Hooks
php// Modify thread query args
add_filter( 'of_thread_query_args', function( array $args, int $room_id ): array {
return $args;
}, 10, 2 );
// Extend reply data sent to frontend
add_filter( 'of_reply_data', function( array $data, int $reply_id ): array {
return $data;
}, 10, 2 );
Shortcodes
| Shortcode | Description |
[oforum] | Full forum index |
[oforum_room id="5"] | Single room |
[oforum_thread id="42"] | Single thread |
[oforum_search] | Search box |
[oforum_notifications] | Notification bell (for use in themes) |