From 274afda5c05c374e3241a93d20b2d2305712d315 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Fri, 7 Nov 2025 09:35:23 +0200 Subject: [PATCH 1/3] Updating Getting started to use correct action hook Also remove unneeded input_schema --- docs/getting-started.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index da05406..295140e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -103,18 +103,14 @@ function my_plugin_get_site_title( array $input = array() ): string { } // 2. Register the ability when the Abilities API is initialized. -// Using `abilities_api_init` ensures the API is fully loaded. -add_action( 'abilities_api_init', 'my_plugin_register_abilities' ); +// Using `wp_abilities_api_init` ensures the API is fully loaded. +add_action( 'wp_abilities_api_init', 'my_plugin_register_abilities' ); function my_plugin_register_abilities() { wp_register_ability( 'my-plugin/get-site-title', array( 'label' => __( 'Get Site Title', 'my-plugin' ), 'description' => __( 'Retrieves the title of the current WordPress site.', 'my-plugin' ), - 'input_schema' => array( - 'type' => 'object', - 'properties' => array(), - 'additionalProperties' => false, - ), + 'category' => 'site', 'output_schema' => array( 'type' => 'string', 'description' => 'The site title.', From 055d7e99e2d68592883450fddfe5868dbe60df9a Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Fri, 7 Nov 2025 09:46:15 +0200 Subject: [PATCH 2/3] Adding a note about default categories --- docs/php-api.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/php-api.md b/docs/php-api.md index 315007a..2874af1 100644 --- a/docs/php-api.md +++ b/docs/php-api.md @@ -2,7 +2,14 @@ ## Registering Categories -Before registering abilities, you must register at least one category. Categories help organize abilities and make them easier to discover and filter. +Before registering abilities, you must need at least one category. Categories help organize abilities and make them easier to discover and filter. + +The Abilities API ships with two default Ability categories: + +- `site`: Abilities that retrieve or modify site information and settings +- `user`: Abilities that retrieve or modify user information and settings. + +Only create new categories if your Ability does not fit one of these two. ### Function Signature From 351429efb498669c99276b8d02937c89a4b3d40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Fri, 14 Nov 2025 12:42:58 +0100 Subject: [PATCH 3/3] Update docs/php-api.md Co-authored-by: John Parris --- docs/php-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/php-api.md b/docs/php-api.md index 2874af1..4461e53 100644 --- a/docs/php-api.md +++ b/docs/php-api.md @@ -2,7 +2,7 @@ ## Registering Categories -Before registering abilities, you must need at least one category. Categories help organize abilities and make them easier to discover and filter. +Before registering abilities, you need at least one category. Categories help organize abilities and make them easier to discover and filter. The Abilities API ships with two default Ability categories: