Skip to content

Abilities API support #549

@swissspidy

Description

@swissspidy

The Abilities API introduced in WordPress 6.9 is a unified registry of callable WordPress capabilities with defined inputs and outputs, built for AI integrations and developer automation. See https://make.wordpress.org/ai/2025/07/17/abilities-api/ for the intro blog post.

Current code:

We want to make sure it works with WP-CLI out of the box. Conceptually that fits well into entity-command. I imagine commands such as:

  • wp ability list [--field=<field>] [--fields=<fields>] [--format=<format>] - list details about all abilities registered with wp_register_ability()
  • wp ability exists <name> - maps to wp_has_ability()
  • wp ability get <name>[--field=<field>] [--fields=<fields>] [--format=<format>] - show a specific ability instance retrieved via wp_get_ability()
  • wp ability execute <name> [<input>] - if input is omitted, the value is read from STDIN. We can probably simply expect a valid JSON string here.
  • wp ability category list [--field=<field>] [--fields=<fields>] [--format=<format>] - list categories
  • wp ability category exists <name> - whether a category exists
  • wp ability category get <name> [--field=<field>] [--fields=<fields>] [--format=<format>] - get an individual category

Filtering/querying abilities by categories will be added to core in the future, so we don't need to cover that for now.

Since this functionality is only available in 6.9+, we can add a before_invoke hook checking for the WordPress version.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions