[wp-trac] [WordPress Trac] #64616: Abilities API: Add core/update-settings ability

WordPress Trac noreply at wordpress.org
Mon Feb 9 18:18:29 UTC 2026


#64616: Abilities API: Add core/update-settings ability
------------------------------+-----------------------
 Reporter:  jorgefilipecosta  |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  7.0
Component:  AI                |    Version:  trunk
 Severity:  normal            |   Keywords:  has-patch
  Focuses:                    |
------------------------------+-----------------------
 This ticket proposes adding a `core/update-settings` ability to complement
 the existing `core/get-settings` ability, providing a symmetric API for
 reading and writing settings through the Abilities API.

 === Proposed Solution ===

 Add `core/update-settings` ability with the following characteristics:

 **Input/Output Symmetry:**
 - Input accepts settings grouped by registration group (same structure
 returned by `core/get-settings`)
 - Output returns `updated_settings` (with updated values) and
 `validation_errors` (with error messages) in the same grouped structure

 **Example Usage:**
 {{{
 // Get current settings
 const settings = await wp.apiFetch({
   path: '/wp-abilities/v1/abilities/core/get-settings/run'
 });

 // Modify and update
 settings.general.blogname = 'New Site Title';
 await wp.apiFetch({
   path: '/wp-abilities/v1/abilities/core/update-settings/run',
   method: 'POST',
   data: { input: { settings } }
 });
 }}}

 **Security:**
 - Requires `manage_options` capability
 - Only settings with `show_in_abilities = true` can be modified
 - Settings must be placed in their correct registration group
 - Values are validated against registered schemas
 - Registered sanitize callbacks are applied

 **Annotations:**
 - `readonly: false` - This ability modifies settings
 - `destructive: false` - Changes can be reverted
 - `idempotent: true` - Same input produces same result


 === Related ===

 - Part of: https://github.com/WordPress/ai/issues/40
 - Inspired by: https://github.com/galatanovidiu/mcp-adapter-
 implementation-example

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64616>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list