Add these from a plugin or a theme’s functions.php. Every hook name starts with kanbanwp_.
Actions
| Action | Parameters | Fires |
|---|---|---|
kanbanwp_init | none | After KanbanWP has loaded its modules. |
kanbanwp_task_created | $task_id, $task | After a task is created through the REST API or the MCP server, by a recurring task, or from a form, a WooCommerce order or product, or a WordPress post. Forms, WooCommerce and posts fire it since version 1.0.7. |
kanbanwp_task_updated | $task_id, $task, $changes | After a task is updated through the REST API or the MCP server. |
kanbanwp_task_moved | $task_id, $task, $old_stage_id, $new_stage_id | After a task changes stage through the REST API or the MCP server, including bulk moves. |
kanbanwp_task_deleted | $task_id, $board_id | After a task is deleted through the REST API. |
kanbanwp_task_assigned | $task_id, $user_id, $actor | After someone is assigned to a task. |
kanbanwp_comment_added | $comment_id, $comment | After a comment is added through the REST API or the MCP server. |
kanbanwp_member_added | $board_id, $user_id, $role | After a board member is added. |
kanbanwp_member_removed | $board_id, $user_id | After a board member is removed. |
kanbanwp_form_submission | $args (array) | You fire it. KanbanWP listens and creates a task. |
kanbanwp_board_created | $board_id | Once for every new board: created in wp-admin, through the REST API, by duplicating, by an import, by AI board generation or with WP-CLI. Versions up to 1.0.3 never fired it. |
The task and comment actions fire from the REST API and the MCP server. Changes made with WP-CLI or by calling model classes directly do not trigger them.
Creating tasks from a form
Fire kanbanwp_form_submission from any form plugin’s success hook:
do_action( 'kanbanwp_form_submission', array(
'title' => 'New lead: ACME Corp', // required
'board_id' => 3, // required
'stage_id' => 12, // optional, defaults to the first stage
'description' => 'Asked for a quote.',
'email' => '[email protected]', // appended to the description
'name' => 'Jane Doe', // appended to the description
'meta' => array( 'source' => 'contact-form' ),
) );
If board_id is missing or invalid, nothing is created and the failure is written to the PHP error log. See Forms.
Filters
| Filter | Parameters | Purpose |
|---|---|---|
kanbanwp_ai_system_prompt | $system, $args | Change the system prompt for every AI call. |
kanbanwp_ai_allowed | $allowed, $user_id | Return true or false to override who may use AI. null keeps the default role check. |
kanbanwp_mcp_tool_result | $result, $tool, $args | Change MCP tool output before it is returned. Tools: list_boards, get_board, list_tasks, create_task, update_task, move_task, add_comment. |
kanbanwp_webhook_payload | $payload, $event, $webhook | Change an outgoing webhook payload before it is signed and sent. |
kanbanwp_webhook_events | $events | Register extra webhook event keys. |
kanbanwp_board_url | $url, $board_id, $task_id | Change the board link used in notifications and linked posts. |
kanbanwp_board_url_for_user | $url, $board_id, $task_id, $user_id | Change the board link one user gets in notifications, digest emails and the block-editor sidebar. Users without access to the wp-admin board screen get the site home page by default, so point this at the page with your board shortcode. An empty string hides the sidebar’s “Open board” button. Added in 1.0.7. |
kanbanwp_public_board_url | $url, $board_id, $token | Change the generated public link. |
kanbanwp_admin_parent_slug | $slug | Change the admin menu that KanbanWP’s sub-pages attach to. Default kanbanwp. |
kanbanwp_import_drafts_post_types | $post_types | Post types offered for importing drafts. Default post and page. |
Examples
add_filter( 'kanbanwp_ai_system_prompt', function ( $system, $args ) {
return $system . "\nAlways reply in American English.";
}, 10, 2 );
add_filter( 'kanbanwp_ai_allowed', function ( $allowed, $user_id ) {
return user_can( $user_id, 'edit_posts' ) ? true : $allowed;
}, 10, 2 );
Webhook events
Event keys use underscores, not dots: task_created, task_updated, task_moved, task_deleted, comment_added and board_created. The payload contains event, site, board_id, task_id, data and sent_at. The webhook object passed to the filter includes its secret, so never log it. A webhook only receives events from the board it belongs to, unless a site admin made it site-wide (All boards). A new board has no webhooks of its own, so board_created reaches site-wide webhooks only. See Webhooks.