| 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() |
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_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_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).
| 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.