
外掛標籤
開發者團隊
原文外掛簡介
HameThread turns WordPress into a thread-based Q&A forum / support desk without a heavyweight setup. Each topic is a thread post and replies are ordinary WordPress comments, so everything you already know about moderation, roles and the REST API keeps working.
It shines where a generic forum does not:
WooCommerce product support — show a “Get support” button on a product and collect purchaser questions as threads, right inside My Account.
Private threads — let users open threads only the author, invited people and editors can read. Perfect for paid or sensitive support.
Best answer — mark the reply that resolved the question and flag the whole thread as Resolved.
Block-first — drop the Thread Button block on any page to let visitors start a thread. No template editing, no code.
Features
thread post type with a topic taxonomy
Comment-based replies with AJAX/REST posting (no full page reload)
Best answer & resolved / unresolved status
Private threads with capability checks
Auto-close threads after a period of inactivity
Upvotes on comments
E-mail notifications to thread subscribers
JSON-LD (QAPage) structured data for SEO
WooCommerce My Account support page and per-product support button
Optionally enable comment threads on any public post type
Admin settings under Settings → Discussion (no code required for common tweaks)
Customization
Common settings are available under Settings → Discussion:
Thread description
Allow users to start private threads
Post types that get HameThread-style comment threads
Everything else is filterable. See For developers below.
For developers
Replies are standard WordPress comments and threads are a standard post type, so core hooks apply. On top of that, HameThread exposes many filters/actions. The most useful ones:
Hook
Type
Purpose
hamethread_before_thread_form / hamethread_after_thread_form
action
Add markup/fields to the thread form
hamethread_new_thread_post_params
filter
Register extra REST parameters for new threads
hamethread_new_thread_post_arg
filter
Modify the post array before a thread is inserted
hamethread_new_thread_validation
filter
Add validation errors (WP_Error)
hamethread_new_thread_inserted
action
React after a thread is created
hamethread_before_comment_form / hamethread_after_comment_form
action
Add markup/fields to the comment form
hamethread_new_comment_params
filter
Modify comment data before insert
hamethread_default_subscribers / hamethread_subscribers
filter
Control who is notified
hamethread_user_can_start_private_thread
filter
Allow private threads
hamethread_user_can_comment / hamethread_user_can_post
filter
Capability checks
hamethread_dynamic_comment_post_types
filter
Post types that get comment threads
hamethread_post_setting / hamethread_post_type / hamethread_taxonomy
filter
Customize the post type & taxonomy
hamethread_template
filter
Override template parts
Example — add a field to the thread form and store it:
// 1. Render the field.
add_action( 'hamethread_after_thread_form', function ( $args, $default ) {
if ( $args['post'] ) {
return; // Only on new threads.
}
echo ' Notify staff';
}, 10, 2 );
// 2. Register the REST parameter.
add_filter( 'hamethread_new_thread_post_params', function ( $params ) {
$params['notify_staff'] = [ 'type' => 'integer', 'default' => 0 ];
return $params;
} );
// 3. React after the thread is created.
add_action( 'hamethread_new_thread_inserted', function ( $post_id, $request ) {
if ( $request->get_param( 'notify_staff' ) ) {
// notify…
}
}, 10, 2 );
Example — enable comment threads on the post post type:
add_filter( 'hamethread_dynamic_comment_post_types', function ( $post_types ) {
$post_types[] = 'post';
return $post_types;
} );
A full list of hooks lives in the source. See the app/ directory and the GitHub repository.
