{"id":932,"date":"2026-10-18T13:15:10","date_gmt":"2026-10-18T13:15:10","guid":{"rendered":"http:\/\/plugin-docs.com\/?post_type=doc&#038;p=932"},"modified":"2026-10-18T13:27:41","modified_gmt":"2026-10-18T13:27:41","slug":"wordpress-trash-post-trigger","status":"publish","type":"doc","link":"https:\/\/dragwyb.com\/docs\/wordpress-trash-post-trigger\/","title":{"rendered":"Use the WordPress Trash Post Trigger"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The <strong>WordPress Trash Post Trigger<\/strong> trigger is available in the WordPress <strong>Post<\/strong> group in the AI Agent Workflows editor. It starts a workflow when WordPress fires the <code>wp_trash_post<\/code> hook.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Screenshot to add: [Workflow editor showing the wp_trash_post trigger and its configuration]<\/p>\n\n\n<h2 class=\"wp-block-heading\">When this trigger fires<\/h2>\n\n\n<p class=\"wp-block-paragraph\">This catalog entry listens to <code>wp_trash_post<\/code>. The separate <strong>Post Moved to Trash<\/strong> entry uses the same hook, so adding both triggers can cause overlapping workflow runs for one trash event.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Data available to later nodes<\/h2>\n\n\n<p class=\"wp-block-paragraph\">For recognized post hooks, the plugin can provide normalized values such as <code>source<\/code>, <code>event<\/code>, <code>post_id<\/code>, <code>post_title<\/code>, <code>post_content<\/code>, <code>post_content_text<\/code>, <code>post_excerpt<\/code>, <code>post_status<\/code>, <code>post_type<\/code>, <code>post_name<\/code>, <code>post_author<\/code>, <code>post_date<\/code>, <code>post_modified<\/code>, and <code>post_parent<\/code> when post data is available. Inspect a captured sample before relying on a specific field.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Configure the trigger<\/h2>\n\n\n<ol class=\"wp-block-list\">\n<li>Open the workflow in the visual editor and open the node picker.<\/li>\n\n<li>Select <strong>WordPress<\/strong>, then <strong>Post<\/strong>, and add the trigger.<\/li>\n\n<li>If the node exposes <strong>Post Types<\/strong>, leave it empty for supported posts, pages, and custom post types, or enter comma-separated slugs such as <code>post,page<\/code>. Internal WordPress content types are skipped.<\/li>\n\n<li>Save and test with non-critical content, then inspect the sample before mapping values into later nodes.<\/li>\n<\/ol>\n\n\n<h2 class=\"wp-block-heading\">Source hook<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Catalog hook: <code>wp_trash_post<\/code>. This guide is based on the supplied plugin source and does not claim a live event has been tested.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Learn how this catalog entry maps to WordPress&#8217;s wp_trash_post hook and why it overlaps with the separate Post Moved to Trash trigger.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":956,"menu_order":0,"template":"","class_list":["post-932","doc","type-doc","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc\/932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc\/932\/revisions"}],"predecessor-version":[{"id":983,"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc\/932\/revisions\/983"}],"up":[{"embeddable":true,"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc\/956"}],"wp:attachment":[{"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/media?parent=932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}