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 by a recurring task. |
kanbanwp_task_updated | $task_id, $task, $changes | After a task is updated through the REST API. |
kanbanwp_task_moved | $task_id, $task, $old_stage_id, $new_stage_id | After a task changes stage through the REST API, 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. |
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 | KanbanWP listens for it, but nothing in version 1.0.0 fires it. |
Because the task and comment actions fire from the REST layer, 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' => 'jane@example.com', // 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_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. Since nothing fires kanbanwp_board_created in 1.0.0, the board_created webhook does not currently send. See Webhooks.