WP Manifestindependent plugin directory
manifest / social / forum-threaded

Threaded Forum

Threaded community forum for WordPress, built on native Custom Post Types and comments — no external forum framework needed.

by ata · github.com/elmira-ashrafi/forum-threaded · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/elmira-ashrafi/forum-threaded/archive/refs/heads/main.zip

Readme

Threaded Forum

A WordPress plugin that turns any page into a lightweight community forum, built entirely on top of WordPress's own Custom Post Types and native comment system — no external forum framework, no separate database tables, and full compatibility with existing WordPress features like moderation, notifications, and REST API access.

Topics are just posts, and replies are just WordPress comments — so everything you already know about managing WordPress content (and every plugin that hooks into it) works here too.


✨ Key Features

  • Custom "Forum Topic" post type — topics are registered as their own post type (forum_topic) with title, editor, author, and comments support, a dedicated archive at /forum/, and full REST API exposure.
  • Threaded replies via native WordPress comments — replies use WordPress's built-in comment system (including nested/threaded replies), so no custom reply engine was needed; comments are forced open on every topic regardless of the site's default comment settings.
  • Customized comment form for forum context — the comment form's label and submit button are rewritten specifically for topics ("express your Idea" / "share your idea"), without affecting comment forms anywhere else on the site.
  • Front-end topic submission — logged-in users can create new topics directly from the front end via a nonce-verified form handler (no admin access required), with sanitized title/content and an automatic redirect to the new topic on success.
  • Shortcode-driven UI — three shortcodes give you full control over where and how the forum appears:
    • [tforum_topic_form] — renders the "new topic" submission form
    • [tforum_topics] — lists topics (supports a posts_per_page attribute)
    • [tforum_replies] — renders the reply thread for the current topic
  • Clean, modular architecture — built on a hook-loader pattern (TForum_Loader) that centralizes every add_action/add_filter registration, keeping each concern (post type, comments, assets, shortcodes, form handling) in its own class instead of one large file.
  • Conditional asset loading — frontend CSS/JS (plus WordPress's native comment-reply script for threaded replies) only load on forum topic pages/archives, not site-wide.

🧱 Architecture

TForum_Plugin (bootstraps everything)
        │
        ▼
   TForum_Loader   ← central registry for all hooks
        │
   ┌────┼─────────────┬─────────────┬─────────────┐
   ▼    ▼             ▼             ▼             ▼
Post   Comments    Assets      Shortcodes     Topic Form
Type   (threading, (conditional (frontend UI)  (submission
(CPT)   form text)  loading)                    handling)

Each class registers its own hooks through the shared loader rather than calling add_action/add_filter directly — new features can be added as self-contained classes without touching existing ones.


📋 Requirements

  • WordPress 6.x+ (uses show_in_rest, wp_required_field_indicator())
  • PHP 7.4+

⚙️ Installation & Usage

  1. Copy the plugin folder into wp-content/plugins/ and activate it from the WordPress admin panel.
  2. Create a page (e.g. "Forum") and add the shortcodes you need:
    [tforum_topic_form]
    [tforum_topics posts_per_page="20"]
  3. Individual topic pages automatically render at /forum/topic-slug/ — add [tforum_replies] to your single-topic template (or theme template for the forum_topic post type) to display the reply thread.
  4. Only logged-in users can submit new topics; make sure your site has a working login/registration flow for the audience you want posting.

Author

Elmira Ashrafigithub.com/elmira-ashrafi

Read the full README on GitHub →