DocsOForumThread System
Reference

Thread System

OForumorravo.com/docs/oforum/thread-system

Threads are of_thread CPT posts. URLs are /forum/thread/[slug]/.

Thread Meta Keys

KeyTypeDescription
of_thread_room_idintRoom the thread belongs to
of_thread_typestringdiscussion, question, announcement, showcase
of_thread_stickyint1 = pinned to top of room
of_thread_closedint1 = no new replies (except mods)
of_thread_solvedint1 = has an accepted solution
of_thread_solution_idintReply ID of accepted solution
of_thread_reply_countintCached reply count
of_thread_viewsintView count
of_thread_last_replydatetimeLast reply timestamp (for sorting)
of_thread_last_reply_uidintUser ID of last replier

Querying threads

php$result = OF_Query::get_threads([
    'room_id'      => 5,
    'thread_type'  => 'question',
    'sticky_first' => true,
    'page'         => 1,
    'per_page'     => 25,
    'orderby'      => 'last_reply',  // last_reply | date | reply_count
]);

// Returns:
// [
//   'threads'   => [...],  // array of formatted thread arrays
//   'total'     => 42,
//   'max_pages' => 2,
// ]

Thread admin actions (AJAX)

All admin thread actions use the of_thread_action AJAX endpoint with action_type:

  • sticky — Toggle sticky
  • close — Toggle closed
  • delete — Trash the thread
  • approve — Publish a pending thread

Thread System — OForum Docs — Orravo