Permission levels
| Constant | Level | Description |
|---|---|---|
OF_Permissions::LEVEL_BANNED | -1 | Banned user |
OF_Permissions::LEVEL_NEW | 0 | New member (first posts need approval) |
OF_Permissions::LEVEL_MEMBER | 1 | Regular member |
OF_Permissions::LEVEL_MOD | 2 | Room moderator |
OF_Permissions::LEVEL_ADMIN | 3 | Admin (WordPress admins auto-get this) |
Set a user's permission level:
phpOF_Permissions::set_level($user_id, OF_Permissions::LEVEL_MOD);
Auto-moderation
When a new thread or reply is submitted by a user at LEVEL_NEW (trust level 0), the post status is automatically set to pending instead of publish. It appears in the Moderation → Pending Approval queue.
Report queue
Users can report content by clicking the Report button on any reply. Reports go into the moderation queue at Moderation → Flagged Reports.
From the queue, moderators can:
- ✓ Approve — publish the post
- ⚠ Warn — send a moderation email to the author (no post action)
- 🗑 Delete — trash the post
- ✕ Dismiss — dismiss the report without action
Shadow ban
Shadow banning marks a user's future posts as only visible to themselves and moderators. Other users do not see the posts.
phpOF_Moderation::shadow_ban_user($user_id, $mod_user_id);
OF_Moderation::unshadow_ban_user($user_id, $mod_user_id);
$is_banned = OF_Moderation::is_shadow_banned($user_id);
IP ban
Ban an IP address from posting:
php// Permanent ban
OF_Moderation::ban_ip('192.168.1.1', $mod_id, 'Spam', null);
// Timed ban (expires 2026-12-31)
OF_Moderation::ban_ip('192.168.1.1', $mod_id, 'Abuse', '2026-12-31 23:59:59');
OF_Moderation::unban_ip('192.168.1.1', $mod_id);
$is_banned = OF_Permissions::is_ip_banned('192.168.1.1');
IP bans block the post/reply REST API endpoints. The auto-moderation hook also checks IPs on reply submission.
Audit log
Every moderation action is logged to wp_of_mod_log. View the log at Moderation → Audit Log.
php$log = OF_Moderation::get_log(50); // Last 50 entries
