@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/portfolio/lh-mcp-general-abilities/>
  a sioc:Post ;
  dc:title "Trashing drafts" ;
  dcterms:identifier 152765 ;
  dc:modified "2026-10-29T09:19:32Z"^^xsd:dateTime ;
  dc:created "2026-10-29T09:19:32Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-mcp-general-abilities/trashing-drafts/> ;
  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-mcp-general-abilities/\">LH MCP General Abilities</a></li></ul><p class=\"wp-block-paragraph\">Since 1.21.0, <code>trash-post</code> lets an agent remove a draft it no longer needs, such as a reply draft it has superseded, and <code>untrash-post</code> lets it undo that. Before, a draft an agent made could only be removed by a person.</p><h2 class=\"wp-block-heading\">Trash only</h2><p class=\"wp-block-paragraph\"><code>trash-post</code> never deletes permanently: emptying the trash stays a human action. If a site has the trash switched off (<code>EMPTY_TRASH_DAYS</code> of 0), <code>wp_trash_post()</code> deletes outright, so the ability refuses instead. Both abilities need <code>delete_post</code> on the post, the capability WordPress checks before trashing or restoring in wp-admin, and both take <code>site_id</code>.</p><h2 class=\"wp-block-heading\">Same reach as update-post</h2><p class=\"wp-block-paragraph\">What can be trashed comes from the same per-type rules as <code>create-post</code> and <code>update-post</code> (see <a href=\"https://lhero.org/portfolio/lh-mcp-general-abilities/menus-template-parts-and-synced-patterns/\">Menus, template parts and synced patterns</a>), so the two cannot drift. Each rule has a <code>trash</code> list of statuses, defaulting to its <code>update</code> list, with auto-draft accepted wherever draft is. Posts, pages and other content types can be trashed while draft, pending or auto-draft, so published, scheduled and private posts are refused. Menus, template parts and synced patterns set the list empty and are refused in any status.</p><p class=\"wp-block-paragraph\">A rule with a <code>trash</code> list but empty <code>create</code> and <code>update</code> lists is trash-only: its drafts can be trashed and restored, but the type is not writable through <code>create-post</code> or <code>update-post</code>, and <code>list-post-types</code> does not report it as writable. LH Email uses this for compose drafts, since publishing a compose post sends it.</p><h2 class=\"wp-block-heading\">Restoring</h2><p class=\"wp-block-paragraph\"><code>untrash-post</code> restores only what <code>trash-post</code> could have trashed: the status WordPress recorded at trashing (<code>_wp_trash_meta_status</code>) must be on the type&#8217;s <code>trash</code> list. A post that was live before a person trashed it stays a human restore. The post returns to its previous status rather than core&#8217;s default of draft, except that an auto-draft comes back as a draft.</p><p class=\"wp-block-paragraph\">Both abilities are idempotent: trashing a post already in the trash, or restoring one that is not, succeeds with a notice and changes nothing. Every trash and restore is recorded in LH Audit Trail as <code>content.post_trashed</code> or <code>content.post_restored</code> (staff only, kept 370 days).</p>"^^rdf:XMLLiteral ;
  sioc:content "Part of: LH MCP General AbilitiesSince 1.21.0, trash-post lets an agent remove a draft it no longer needs, such as a reply draft it has superseded, and untrash-post lets it undo that. Before, a draft an agent made could only be removed by a person.Trash onlytrash-post never deletes permanently: emptying the trash stays a human action. If a site has the trash switched off (EMPTY_TRASH_DAYS of 0), wp_trash_post() deletes outright, so the ability refuses instead. Both abilities need delete_post on the post, the capability WordPress checks before trashing or restoring in wp-admin, and both take site_id.Same reach as update-postWhat can be trashed comes from the same per-type rules as create-post and update-post (see Menus, template parts and synced patterns), so the two cannot drift. Each rule has a trash list of statuses, defaulting to its update list, with auto-draft accepted wherever draft is. Posts, pages and other content types can be trashed while draft, pending or auto-draft, so published, scheduled and private posts are refused. Menus, template parts and synced patterns set the list empty and are refused in any status.A rule with a trash list but empty create and update lists is trash-only: its drafts can be trashed and restored, but the type is not writable through create-post or update-post, and list-post-types does not report it as writable. LH Email uses this for compose drafts, since publishing a compose post sends it.Restoringuntrash-post restores only what trash-post could have trashed: the status WordPress recorded at trashing (_wp_trash_meta_status) must be on the type&#8217;s trash list. A post that was live before a person trashed it stays a human restore. The post returns to its previous status rather than core&#8217;s default of draft, except that an auto-draft comes back as a draft.Both abilities are idempotent: trashing a post already in the trash, or restoring one that is not, succeeds with a notice and changes nothing. Every trash and restore is recorded in LH Audit Trail as content.post_trashed or content.post_restored (staff only, kept 370 days)." ;
  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> .
