feat(wordpress): add category/tag CRUD tools, fix delete-status and dead-field bugs#5360
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Bug fixes and cleanup: delete tools now use API fidelity: optional numeric fields use Reviewed by Cursor Bugbot for commit 4bc8d28. Configure here. |
Greptile SummaryThis PR completes taxonomy CRUD parity for the WordPress integration by adding
Confidence Score: 5/5Safe to merge — all changes are additive new tools or targeted bug fixes with no breaking changes to existing tool IDs, output shapes, or required fields. The || to ?? fix is applied consistently across all six delete tools, the new taxonomy tools mirror the established patterns for create/list, the dead-param removals are confirmed safe (media always force-deletes, hideEmpty was never wired), and the numeric guard fixes correct a real scenario where zero values were silently dropped. The searchType block input keeps its existing ID so stored workflows are unaffected; only the outgoing API key moves from type to subtype, which matches actual WP REST API search semantics. No regressions found in wiring, types, or registry registration. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Block UI wordpress.ts] -->|operation select| B{Operation}
B --> C[Category CRUD]
B --> D[Tag CRUD]
B --> E[Search Content]
B --> F[Delete Tools]
C --> C1[get_category GET]
C --> C2[update_category POST]
C --> C3[delete_category DELETE force=true]
D --> D1[get_tag GET]
D --> D2[update_tag POST]
D --> D3[delete_tag DELETE force=true]
E --> E1[searchType maps to subtype param]
F --> F1[post/page/comment: deleted ?? true]
F --> F2[media: force param removed, always force=true]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Block UI wordpress.ts] -->|operation select| B{Operation}
B --> C[Category CRUD]
B --> D[Tag CRUD]
B --> E[Search Content]
B --> F[Delete Tools]
C --> C1[get_category GET]
C --> C2[update_category POST]
C --> C3[delete_category DELETE force=true]
D --> D1[get_tag GET]
D --> D2[update_tag POST]
D --> D3[delete_tag DELETE force=true]
E --> E1[searchType maps to subtype param]
F --> F1[post/page/comment: deleted ?? true]
F --> F2[media: force param removed, always force=true]
Reviews (9): Last reviewed commit: "fix(wordpress): remove invalid Attachmen..." | Re-trigger Greptile |
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8cb03d7. Configure here.
|
@greptile review |
|
@cursor review |
|
@greptile review |
|
@cursor review |
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3e54a46. Configure here.
|
@greptile review |
|
@cursor review |
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 44a6963. Configure here.
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5686166. Configure here.
…ead-field bugs
- Add wordpress_{get,update,delete}_category and _tag tools for full taxonomy parity
- Fix `deleted: data.deleted || true` always evaluating true across all 6 delete tools (posts/pages/media/comments/categories/tags)
- Remove dead `force` param from delete_media (endpoint always force-deletes; param had zero effect)
- Remove unwired `hideEmpty` block input
- Normalize search_content perPage/page visibility to user-or-llm for consistency
…n delete_category/tag count and parent can legitimately be 0 (empty term, top-level category); || was dropping those values, same antipattern already fixed for `deleted` in this PR. Flagged independently by Greptile and Cursor Bugbot.
…te tools Same || antipattern already fixed for category/tag delete tools was still present in delete_post/page/comment/media for id, author, featured_media, menu_order, parent, post — all legitimately 0 in common cases (no featured image, top-level page/comment). Found by a final independent validation pass.
…block param mapping Truthy check on params.categoryParent treated a resolved numeric 0 (root-level, no parent) as unset. Flagged by Cursor Bugbot on create_category/update_category.
…ield left blank description used !== undefined (numeric-field convention) instead of a truthy check (string-field convention used everywhere else in this codebase, e.g. update_post/update_page excerpt), so an untouched empty description field silently wiped existing text on every update. Flagged by Cursor Bugbot.
…osure gaps - search_content.ts: type param was mislabeled with subtype's vocabulary (post/page/attachment); real WP type enum is post/term/post-format. Rewired the block's Content Type dropdown to map to subtype (which is what post/page/attachment actually filter), not type. - Widened subBlock conditions so params already read by tools.config.params are actually reachable in the UI: commentPostId for list_comments, categories/tags for list_posts, parent for list_pages. - Added missing subBlocks for tool params with no UI path: comment parent/authorName/authorEmail/authorUrl (create_comment), media description (upload_media), author filter (list_posts). - Extended the ?? / !== undefined fix (already applied to categoryParent) to the same class of param across the block: featuredMedia, page parent, menuOrder, and the new commentParent/listAuthor mappings. - Fixed featuredMedia/parent truthy-check inconsistency in create_post, update_post, create_page, update_page, create_category, create_comment body builders to match the !== undefined convention used elsewhere. Found by an independent final validation pass across 3 parallel agents.
…w compat The type/subtype fix should only change which API param the field feeds (subtype, not type) — renaming the subBlock id to searchSubtype broke already-saved workflows with a search content-type filter set, since the block would stop reading the old searchType key. Reverted the id rename, kept the underlying subtype mapping fix. Flagged by Cursor Bugbot.
…hor input type - Search Content's "Content Type" dropdown offered Attachment, which maps to subtype=attachment. WP core's WP_REST_Post_Search_Handler explicitly excludes attachment from valid subtypes (media isn't searchable via /search) — selecting it guaranteed a 400 rest_invalid_param. Removed the option; only Post/Page (the only valid subtypes) remain. - listAuthor was declared type: 'string' in the inputs catalog despite being Number()-coerced before use, inconsistent with every other ID-like field (postId, pageId, categoryId, commentParent, etc. are all 'number'). Found by an independent final pre-merge validation pass, requested before merge to be certain of full API alignment.
5686166 to
4bc8d28
Compare
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4bc8d28. Configure here.
Summary
wordpress_{get,update,delete}_categoryandwordpress_{get,update,delete}_tagtools for full taxonomy CRUD parity (create/list already existed)deleted: data.deleted || truebug across all 6 delete tools (post/page/media/comment/category/tag) — the||operator meant the field could never reportfalse, even when a delete was trashed rather than force-deleted; changed to?? trueforceparam fromwordpress_delete_media— the endpoint always force-deletes (media has no trash), so the param had zero effect on the request; also dropped the corresponding UI togglehideEmptyblock input (no backing subblock or tool param)search_contentperPage/pagevisibility touser-or-llmfor consistency with other list toolsType of Change
Testing
Tested manually. Ran
bun run check:api-validation,bunx tsc --noEmit, andbiome checkclean on all changed/added files. Verified backward compatibility — no existing tool IDs, output fields, or required flags changed; only additions plus two confirmed-dead-code removals.Checklist