Digital Sovereignty for everyone

Hooks and cron

Hook Fired when
lh_tasks_task_created After a task is created (create_task())
lh_tasks_task_claimed After a successful atomic claim. From 1.17.0 lh-tasks itself uses it to start the claim’s maximum lease (see Task context on write abilities)
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). From 1.16.0 lh-tasks itself uses it to remove the task’s follow-up notifications
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, and from 1.17.0 the automatic renewal by a write ability called with the task) — 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. From 1.16.0 lh-tasks itself uses it to remove the task’s follow-up notifications
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_max_claim_lease_seconds (filter) How long after a task is claimed write abilities called with it stop renewing the claim (default 4 hours, at least 60 seconds). Added 1.17.0.
lh_tasks_ability_takes_task_context (filter) Whether an ability gets the optional task_id and claim_token parameters — args: $takes, $name, $args. Default: abilities annotated readonly: false with an object input schema, except mcp-adapter/* and lh-tasks’ own. Added 1.17.0.
lh_tasks_return_follow_up_quiet_days (filter) Days without activity before an assigned task with no due date gets a reminder (default 7, at least 1). Added 1.16.0.
lh_tasks_return_follow_up_overdue_quiet_days (filter) Days without activity before an overdue assigned task gets a reminder (default 1, at least 1). Added 1.16.0.
lh_tasks_return_follow_up_escalate_days (filter) Days after the reminder, still without activity, before the task’s author is told (default 3, at least 1). Added 1.16.0.
lh_tasks_return_follow_up_batch_size (filter) Most tasks one follow-up run handles (default 50). Added 1.16.0.
lh_tasks_follow_up_task (filter) Whether a task is followed up — args: $follow_up, $task_id. Return false to exclude it. Added 1.16.0.
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, or (1.17.0) by passing task_id and claim_token to the write abilities it calls, until its maximum lease runs out.
lh_tasks_follow_up daily, first run 1 to 6 hours after scheduling (1.16.0) Reminds people about quiet or overdue tasks hard-assigned to them, then tells the task’s author if nothing happens (LH_Tasks_follow_up_class; see Architecture notes). Scheduled on each site on init when missing, and removed on deactivation.

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.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.