Skip to content

Abilities API: Category Settings#1144

Open
n7studios wants to merge 1 commit into
abilities-api-post-settingsfrom
abilities-api-category-settings
Open

Abilities API: Category Settings#1144
n7studios wants to merge 1 commit into
abilities-api-post-settingsfrom
abilities-api-category-settings

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

Summary

Registers get and update abilities (MCP tools) for the per-Category Kit settings (Form, Form Position) stored in the _wp_convertkit_term_meta term meta, so an MCP client can fetch and update these settings for any WordPress Category. Scope is deliberately limited to the category taxonomy — 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 via ConvertKit_Term::save()'s existing internal merge.

Ability Description Required input Output
kit/category-settings-get Returns the current Kit settings (form, form_position) for the given Category (WordPress category taxonomy term). { term_id } { term_id, form, form_position }
kit/category-settings-update Updates one or more Kit settings for the given Category. Only the settings provided in the input are updated; other settings are preserved. Unknown keys are rejected. { term_id } plus a partial object of any subset of: form, form_position same shape as kit/category-settings-get (post-save state)

Testing

  • MCPCategorySettingsGetTest: Tests that the MCP tool is registered, permissions are honored (edit_term capability required), defaults are returned when no term meta exists, stored values are returned when set, both form_position enum values (before and after) round-trip correctly, non-category terms (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 on ConvertKit_Term::save()'s internal merge), unknown keys are rejected, form_position values outside the enum are rejected, out-of-range form values are rejected, empty input is rejected, non-category terms are rejected, non-existent term IDs are rejected, and the update → get round-trip returns the updated values.

Checklist

@n7studios n7studios added this to the 3.4.0 milestone Jul 22, 2026
@n7studios n7studios self-assigned this Jul 22, 2026
@github-actions

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios
n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team July 22, 2026 13:42
@n7studios
n7studios marked this pull request as ready for review July 22, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant