DocsOForumForum Structure
Reference

Forum Structure

OForumorravo.com/docs/oforum/forum-structure

Rooms

Rooms are the top-level organization of the forum. Each room is an of_room CPT post with settings stored in post_meta.

Room properties:

PropertyMeta KeyDescription
Namepost_titleDisplay name
Slugpost_nameURL slug
Descriptionpost_contentRoom description
Iconof_room_iconEmoji or text icon
Colorof_room_colorHex color for accent
Visibilityof_room_visibilitypublic, members, or role
Required Roleof_room_required_roleWP role slug (for role-gated rooms)
Sub-room ofpost_parentParent room ID (0 = top-level)
Menu Ordermenu_orderDisplay sort order

Creating a room (PHP):

php$room_id = OF_Rooms::create([
    'name'       => 'General Discussion',
    'icon'       => '💬',
    'color'      => '#38BDF8',
    'visibility' => 'public',
]);

Getting rooms:

php$rooms = OF_Rooms::get_all();         // All rooms (flat array)
$rooms = OF_Rooms::get_all(false);    // Top-level rooms only
$room  = OF_Rooms::get($room_id);     // Single room by ID
$room  = OF_Rooms::get_by_slug('general-discussion');

Visibility check:

php$can_view = OF_Rooms::user_can_view($room_id, $user_id);

Sub-rooms

Set sub_room_of to a parent room ID when creating a room. Sub-rooms appear indented on the forum index under their parent room. Sub-rooms support one level of nesting.


Forum Structure — OForum Docs — Orravo