| Hook | Fired when |
|---|---|
lh_tasks_task_created |
After a task is created (create_task()) |
lh_tasks_task_claimed |
After a successful atomic claim |
lh_tasks_task_completed |
After complete_task(), and (1.11.0) after complete_assigned_task() when a member marks their task done from their profile β args: $post_id, $result (an empty array from the profile) |
lh_tasks_task_failed |
After fail_task() (includes $reason_type as its 5th argument) |
lh_tasks_task_reassigned |
After reassign_task() β args: $post_id, $args, $from_status
|
lh_tasks_task_renewed |
After renew_task() (the renew-claim heartbeat) β args: $post_id, $note. Added 1.7.0. |
lh_tasks_task_admin_overridden |
After edit_task() β args: $post_id, $args, $from_status
|
lh_tasks_task_updated |
After update_task() (the update-task ability) β args: $post_id, $fields, $args. Added 1.9.0. |
lh_tasks_task_note_added |
After add_note() (the add-note ability) logs a note β args: $post_id, $note. Added 1.10.0. |
lh_tasks_task_cancelled |
When a task’s workflow status moves into Cancelled, from any path (fired by set_status()) β args: $post_id, $from_status. Added 1.8.0. |
lh_tasks_task_prerequisite_dropped |
For each unfinished dependent when a blocked_by prerequisite is cancelled, trashed or deleted β args: $dependent_id, $blocker_id, $reason (cancelled|trashed|deleted). Added 1.8.0. |
lh_tasks_task_claim_expired |
After the stale-claim sweep requeues an abandoned claim |
lh_tasks_return_stale_claim_minutes (filter) |
Override the stale-claim timeout (default 10 minutes) |
lh_tasks_return_slug (filter) |
Slug of the profile Tasks tab (default tasks). Added 1.11.0. |
lh_tasks_show_tab (filter) |
Whether a member gets the Tasks tab on their own profile β args: $show, $user_id. Default: while they have open tasks, and on the tab itself. Added 1.11.0. |
lh_tasks_return_max_tasks (filter) |
Most tasks the Tasks tab lists (default 100). Added 1.11.0. |
lh_tasks_return_max_notes_shown (filter) |
Most recent notes shown under each task on the Tasks tab (default 5). Added 1.11.0. |
lh_tasks_return_required_capability (filter) |
Override the capability required to read/write tasks and MCP abilities (default edit_others_posts) |
Workflow status transitions (claim, complete, fail, reassign, renew, edit-task) write directly to the status table and fire their own do_action() calls β they no longer touch wp_posts.post_status at all, so save_post_lh_tasks-task_post will not fire for them. Code that needs to react to a claim, completion, failure, reassignment, renewal, or admin override should hook the corresponding lh_tasks_task_* action rather than save_post, which now only fires for genuine post edits (title/content/native status changes).
Cron
| Hook | Schedule | Purpose |
|---|---|---|
lh_tasks_stale_claim_sweep |
every 5 minutes (custom lh_tasks_five_minutes schedule) |
Requeues tasks stuck in Claimed status longer than the stale-claim timeout (default 10 minutes) back to New. Only releases the claim (assignee) β assigned_to, if set, is untouched. A task can stay ahead of this sweep by calling renew-claim periodically (see MCP abilities), which pushes claimed_at forward and resets the window. |
Future-task activation (scheduled_for) is handled by WordPress’s own core publish_future_post cron; a future_to_publish intercept (added 1.6.0) lands it on lh_tasks-active rather than native publish.
