Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ All taxonomy operations use a single `taxonomy` parameter:
}
```

The `taxonomy` parameter accepts either the taxonomy slug or its `rest_base`
(custom taxonomies can register a rest_base that differs from the slug, e.g.
slug `documentation_category` with rest_base `documentation-categories`).
All taxonomy tools resolve the identifier through a per-site cached
`/wp/v2/taxonomies` lookup and hard-error on unknown taxonomies — there is no
slug fallback. `assign_terms_to_content` derives success from the WordPress
response (the updated content's `rest_base` field must contain the requested
term IDs) rather than echoing the request.

#### Multi-Site Support
All tools accept an optional `site_id` parameter to target specific sites:
```json
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ All taxonomy operations use a single `taxonomy` parameter:
}
```

The `taxonomy` parameter accepts either the taxonomy slug or its `rest_base`
(they can differ for custom taxonomies, e.g. slug `documentation_category`
with rest_base `documentation-categories`). Tools resolve the identifier via
`/wp/v2/taxonomies` and error on unknown taxonomies instead of guessing.
`assign_terms_to_content` verifies the write against the WordPress response
and reports an error if the terms were not actually saved.

## Configuration

### Single Site Configuration
Expand Down
3 changes: 2 additions & 1 deletion src/tools/unified-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ async function getPostTypes(forceRefresh = false, siteId?: string) {
}

// Helper function to get the correct endpoint for a content type
async function getContentEndpoint(contentType: string, siteId?: string): Promise<string> {
// Exported for reuse by unified-taxonomies.ts (assign_terms_to_content / get_content_terms)
export async function getContentEndpoint(contentType: string, siteId?: string): Promise<string> {
// Quick return for standard types
const standardMap: Record<string, string> = {
Comment on lines +96 to 99
'post': 'posts',
Expand Down
Loading