-
Notifications
You must be signed in to change notification settings - Fork 95
Labels
Description
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:
- https://github.com/WordPress/wordpress-develop/blob/328ab83beb153ffa6d5378b26bb4ef2ceee49c47/src/wp-includes/abilities-api.php
- https://github.com/WordPress/wordpress-develop/blob/328ab83beb153ffa6d5378b26bb4ef2ceee49c47/src/wp-includes/abilities.php
- https://github.com/WordPress/wordpress-develop/blob/328ab83beb153ffa6d5378b26bb4ef2ceee49c47/src/wp-includes/abilities-api/class-wp-abilities-registry.php
- https://github.com/WordPress/wordpress-develop/blob/328ab83beb153ffa6d5378b26bb4ef2ceee49c47/src/wp-includes/abilities-api/class-wp-ability-categories-registry.php
- https://github.com/WordPress/wordpress-develop/blob/328ab83beb153ffa6d5378b26bb4ef2ceee49c47/src/wp-includes/abilities-api/class-wp-ability-category.php
- https://github.com/WordPress/wordpress-develop/blob/328ab83beb153ffa6d5378b26bb4ef2ceee49c47/src/wp-includes/abilities-api/class-wp-ability.php
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 withwp_register_ability()wp ability exists <name>- maps towp_has_ability()wp ability get <name>[--field=<field>] [--fields=<fields>] [--format=<format>]- show a specific ability instance retrieved viawp_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 categorieswp ability category exists <name>- whether a category existswp 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.
ernilambarCopilot