Abilities API: Category Settings#1144
Open
n7studios wants to merge 1 commit into
Open
Conversation
WordPress Playground🚀 Your PR has been built and is ready for testing in WordPress Playground! |
n7studios
requested review from
a team,
ciccio-kit and
noelherrick
and removed request for
a team
July 22, 2026 13:42
n7studios
marked this pull request as ready for review
July 22, 2026 13:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Registers get and update abilities (MCP tools) for the per-Category Kit settings (Form, Form Position) stored in the
_wp_convertkit_term_metaterm meta, so an MCP client can fetch and update these settings for any WordPress Category. Scope is deliberately limited to thecategorytaxonomy — matching the plugin's admin UI (ConvertKit_Admin_Category) and frontend read path (ConvertKit_Output::get_term_form_position()) — and non-category terms are rejected with a specific error. Partial updates are supported viaConvertKit_Term::save()'s existing internal merge.categorytaxonomy term).Testing
MCPCategorySettingsGetTest: Tests that the MCP tool is registered, permissions are honored (edit_termcapability required), defaults are returned when no term meta exists, stored values are returned when set, bothform_positionenum values (beforeandafter) round-trip correctly, non-categoryterms (e.g.post_tag) are rejected with a specific error, and non-existent term IDs are rejected.MCPCategorySettingsUpdateTest: Tests that the MCP tool is registered, full and partial updates persist correctly (partial-update behaviour relies onConvertKit_Term::save()'s internal merge), unknown keys are rejected,form_positionvalues outside the enum are rejected, out-of-rangeformvalues are rejected, empty input is rejected, non-categoryterms are rejected, non-existent term IDs are rejected, and the update → get round-trip returns the updated values.Checklist