Set post terms
fabrement-set-post-termsClassify one record: attach EXISTING terms (id|slug|name; create-term first) of ONE taxonomy. mode is REQUIRED and has no default: replace (the terms become exactly terms, anything else is dropped; [] clears) · add (these are added, the rest stay) · remove (these come off, the rest stay). The taxonomy must be attached to that post type. primary (Yoast SEO, hierarchical taxonomies) picks the main one among the terms of the record — the one its breadcrumbs and category URL use; 0 clears it.
Rules: get-skill-doc {id:"content-contract"} — read it before the first call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Required — there is no default. replace: the terms of this taxonomy on this record become exactly `terms`, so anything not listed is DROPPED and [] clears them. add: these terms are added, the rest stay. remove: these are taken off, the rest stay. | |
| terms | Yes | Term ids, slugs or exact names — each must already exist. | |
| primary | No | Optional, needs Yoast SEO: the MAIN term (id|slug|name) of a hierarchical taxonomy — one the record has after this call. Yoast uses it for the breadcrumb trail and the category in URLs; without it Yoast takes the deepest term. 0 clears it (back to the deepest term). | |
| taxonomy | Yes | Taxonomy slug (see list-taxonomies). | |
| contentId | Yes | The content id (list-content / save-content). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| terms | Yes | ||
| primary | No | The main term id when one is set (Yoast); 0 = none. | |
| taxonomy | Yes | ||
| contentId | Yes |