@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/?post_type=lh-portfolio&#038;p=147130>
  a sioc:Post ;
  dc:title "Hooks and cron" ;
  dcterms:identifier 147130 ;
  dc:modified "2026-10-16T20:44:37Z"^^xsd:dateTime ;
  dc:created "2026-09-07T19:13:51Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-tasks/hooks-and-cron/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded "<ul class=\"lh_portfolio-meta\"><li><strong>Part of:</strong> <a href=\"https://lhero.org/portfolio/lh-tasks/\">LH Tasks</a></li></ul><figure class=\"wp-block-table blocks-engine-table-e7ad47f050c0-3\"><table><thead><tr><th>Hook</th><th>Fired when</th></tr></thead><tbody><tr><td><code>lh_tasks_task_created</code></td><td>After a task is created (<code>create_task()</code>)</td></tr><tr><td><code>lh_tasks_task_claimed</code></td><td>After a successful atomic claim. From 1.17.0 lh-tasks itself uses it to start the claim&#8217;s maximum lease (see Task context on write abilities)</td></tr><tr><td><code>lh_tasks_task_completed</code></td><td>After <code>complete_task()</code>, and (1.11.0) after <code>complete_assigned_task()</code> when a member marks their task done from their profile — args: <code>$post_id, $result</code> (an empty array from the profile). From 1.16.0 lh-tasks itself uses it to remove the task&#039;s follow-up notifications</td></tr><tr><td><code>lh_tasks_task_failed</code></td><td>After <code>fail_task()</code> (includes <code>$reason_type</code> as its 5th argument)</td></tr><tr><td><code>lh_tasks_task_reassigned</code></td><td>After <code>reassign_task()</code> — args: <code>$post_id, $args, $from_status</code></td></tr><tr><td><code>lh_tasks_task_renewed</code></td><td>After <code>renew_task()</code> (the <code>renew-claim</code> heartbeat, and from 1.17.0 the automatic renewal by a write ability called with the task) — args: <code>$post_id, $note</code>. Added 1.7.0.</td></tr><tr><td><code>lh_tasks_task_admin_overridden</code></td><td>After <code>edit_task()</code> — args: <code>$post_id, $args, $from_status</code></td></tr><tr><td><code>lh_tasks_task_updated</code></td><td>After <code>update_task()</code> (the <code>update-task</code> ability) — args: <code>$post_id, $fields, $args</code>. Added 1.9.0.</td></tr><tr><td><code>lh_tasks_task_note_added</code></td><td>After <code>add_note()</code> (the <code>add-note</code> ability) logs a note — args: <code>$post_id, $note</code>. Added 1.10.0.</td></tr><tr><td><code>lh_tasks_task_cancelled</code></td><td>When a task&#039;s workflow status moves into Cancelled, from any path (fired by <code>set_status()</code>) — args: <code>$post_id, $from_status</code>. Added 1.8.0. From 1.16.0 lh-tasks itself uses it to remove the task&#039;s follow-up notifications</td></tr><tr><td><code>lh_tasks_task_prerequisite_dropped</code></td><td>For each unfinished dependent when a <code>blocked_by</code> prerequisite is cancelled, trashed or deleted — args: <code>$dependent_id, $blocker_id, $reason</code> (<code>cancelled</code>|<code>trashed</code>|<code>deleted</code>). Added 1.8.0.</td></tr><tr><td><code>lh_tasks_task_claim_expired</code></td><td>After the stale-claim sweep requeues an abandoned claim</td></tr><tr><td><code>lh_tasks_return_stale_claim_minutes</code> (filter)</td><td>Override the stale-claim timeout (default 10 minutes)</td></tr><tr><td><code>lh_tasks_return_max_claim_lease_seconds</code> (filter)</td><td>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.</td></tr><tr><td><code>lh_tasks_ability_takes_task_context</code> (filter)</td><td>Whether an ability gets the optional <code>task_id</code> and <code>claim_token</code> parameters — args: <code>$takes, $name, $args</code>. Default: abilities annotated <code>readonly: false</code> with an object input schema, except <code>mcp-adapter/*</code> and lh-tasks&#039; own. Added 1.17.0.</td></tr><tr><td><code>lh_tasks_return_follow_up_quiet_days</code> (filter)</td><td>Days without activity before an assigned task with no due date gets a reminder (default 7, at least 1). Added 1.16.0.</td></tr><tr><td><code>lh_tasks_return_follow_up_overdue_quiet_days</code> (filter)</td><td>Days without activity before an overdue assigned task gets a reminder (default 1, at least 1). Added 1.16.0.</td></tr><tr><td><code>lh_tasks_return_follow_up_escalate_days</code> (filter)</td><td>Days after the reminder, still without activity, before the task&#039;s author is told (default 3, at least 1). Added 1.16.0.</td></tr><tr><td><code>lh_tasks_return_follow_up_batch_size</code> (filter)</td><td>Most tasks one follow-up run handles (default 50). Added 1.16.0.</td></tr><tr><td><code>lh_tasks_follow_up_task</code> (filter)</td><td>Whether a task is followed up — args: <code>$follow_up, $task_id</code>. Return false to exclude it. Added 1.16.0.</td></tr><tr><td><code>lh_tasks_return_slug</code> (filter)</td><td>Slug of the profile Tasks tab (default <code>tasks</code>). Added 1.11.0.</td></tr><tr><td><code>lh_tasks_show_tab</code> (filter)</td><td>Whether a member gets the Tasks tab on their own profile — args: <code>$show, $user_id</code>. Default: while they have open tasks, and on the tab itself. Added 1.11.0.</td></tr><tr><td><code>lh_tasks_return_max_tasks</code> (filter)</td><td>Most tasks the Tasks tab lists (default 100). Added 1.11.0.</td></tr><tr><td><code>lh_tasks_return_max_notes_shown</code> (filter)</td><td>Most recent notes shown under each task on the Tasks tab (default 5). Added 1.11.0.</td></tr><tr><td><code>lh_tasks_return_required_capability</code> (filter)</td><td>Override the capability required to read/write tasks and MCP abilities (default <code>edit_others_posts</code>)</td></tr></tbody></table></figure><p class=\"wp-block-paragraph\">Workflow status transitions (claim, complete, fail, reassign, renew, edit-task) write directly to the status table and fire their own <code>do_action()</code> calls — they no longer touch <code>wp_posts.post_status</code> at all, so <code>save_post_lh_tasks-task_post</code> will not fire for them. Code that needs to react to a claim, completion, failure, reassignment, renewal, or admin override should hook the corresponding <code>lh_tasks_task_*</code> action rather than <code>save_post</code>, which now only fires for genuine post edits (title/content/native status changes).</p><h2 class=\"wp-block-heading\">Cron</h2><figure class=\"wp-block-table blocks-engine-table-e7ad47f050c0-4\"><table><thead><tr><th>Hook</th><th>Schedule</th><th>Purpose</th></tr></thead><tbody><tr><td><code>lh_tasks_stale_claim_sweep</code></td><td>every 5 minutes (custom <code>lh_tasks_five_minutes</code> schedule)</td><td>Requeues tasks stuck in Claimed status longer than the stale-claim timeout (default 10 minutes) back to New. Only releases the claim (<code>assignee</code>) — <code>assigned_to</code>, if set, is untouched. A task can stay ahead of this sweep by calling <code>renew-claim</code> periodically (see MCP abilities), which pushes <code>claimed_at</code> forward and resets the window, or (1.17.0) by passing <code>task_id</code> and <code>claim_token</code> to the write abilities it calls, until its maximum lease runs out.</td></tr><tr><td><code>lh_tasks_follow_up</code></td><td>daily, first run 1 to 6 hours after scheduling (1.16.0)</td><td>Reminds people about quiet or overdue tasks hard-assigned to them, then tells the task&#039;s author if nothing happens (<code>LH_Tasks_follow_up_class</code>; see Architecture notes). Scheduled on each site on <code>init</code> when missing, and removed on deactivation.</td></tr></tbody></table></figure><p class=\"wp-block-paragraph\">Future-task activation (<code>scheduled_for</code>) is handled by WordPress&#039;s own core <code>publish_future_post</code> cron; a <code>future_to_publish</code> intercept (added 1.6.0) lands it on <code>lh_tasks-active</code> rather than native <code>publish</code>.</p>"^^rdf:XMLLiteral ;
  sioc:content "Part of: LH TasksHookFired whenlh_tasks_task_createdAfter a task is created (create_task())lh_tasks_task_claimedAfter a successful atomic claim. From 1.17.0 lh-tasks itself uses it to start the claim&#8217;s maximum lease (see Task context on write abilities)lh_tasks_task_completedAfter 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&#039;s follow-up notificationslh_tasks_task_failedAfter fail_task() (includes $reason_type as its 5th argument)lh_tasks_task_reassignedAfter reassign_task() — args: $post_id, $args, $from_statuslh_tasks_task_renewedAfter 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_overriddenAfter edit_task() — args: $post_id, $args, $from_statuslh_tasks_task_updatedAfter update_task() (the update-task ability) — args: $post_id, $fields, $args. Added 1.9.0.lh_tasks_task_note_addedAfter add_note() (the add-note ability) logs a note — args: $post_id, $note. Added 1.10.0.lh_tasks_task_cancelledWhen a task&#039;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&#039;s follow-up notificationslh_tasks_task_prerequisite_droppedFor 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_expiredAfter the stale-claim sweep requeues an abandoned claimlh_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&#039; 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&#039;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).CronHookSchedulePurposelh_tasks_stale_claim_sweepevery 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_updaily, 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&#039;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&#039;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." ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
