@@ -46,8 +46,26 @@ final class WP_Abilities_Registry {
4646 * @param string $name The name of the ability. The name must be a string containing a namespace
4747 * prefix, i.e. `my-plugin/my-ability`. It can only contain lowercase
4848 * alphanumeric characters, dashes and the forward slash.
49- * @param array<string,mixed> $args An associative array of arguments for the ability. See wp_register_ability() for
50- * details.
49+ * @param array<string,mixed> $args {
50+ * An associative array of arguments for the ability.
51+ *
52+ * @type string $label The human-readable label for the ability.
53+ * @type string $description A detailed description of what the ability does.
54+ * @type string $category The category slug this ability belongs to.
55+ * @type callable $execute_callback A callback function to execute when the ability is invoked.
56+ * Receives optional mixed input and returns mixed result or WP_Error.
57+ * @type callable $permission_callback A callback function to check permissions before execution.
58+ * Receives optional mixed input and returns bool or WP_Error.
59+ * @type array<string,mixed> $input_schema Optional. JSON Schema definition for the ability's input.
60+ * @type array<string,mixed> $output_schema Optional. JSON Schema definition for the ability's output.
61+ * @type array<string,mixed> $meta {
62+ * Optional. Additional metadata for the ability.
63+ *
64+ * @type array<string,bool|string> $annotations Optional. Annotation metadata for the ability.
65+ * @type bool $show_in_rest Optional. Whether to expose this ability in the REST API. Default false.
66+ * }
67+ * @type string $ability_class Optional. Custom class to instantiate instead of WP_Ability.
68+ * }
5169 * @return WP_Ability|null The registered ability instance on success, null on failure.
5270 *
5371 * @phpstan-param array{
@@ -94,7 +112,25 @@ public function register( string $name, array $args ): ?WP_Ability {
94112 *
95113 * @since 6.9.0
96114 *
97- * @param array<string,mixed> $args The arguments used to instantiate the ability.
115+ * @param array<string,mixed> $args {
116+ * An associative array of arguments for the ability.
117+ *
118+ * @type string $label The human-readable label for the ability.
119+ * @type string $description A detailed description of what the ability does.
120+ * @type string $category The category slug this ability belongs to.
121+ * @type callable $execute_callback A callback function to execute when the ability is invoked.
122+ * Receives optional mixed input and returns mixed result or WP_Error.
123+ * @type callable $permission_callback A callback function to check permissions before execution.
124+ * Receives optional mixed input and returns bool or WP_Error.
125+ * @type array<string,mixed> $input_schema Optional. JSON Schema definition for the ability's input.
126+ * @type array<string,mixed> $output_schema Optional. JSON Schema definition for the ability's output.
127+ * @type array<string,mixed> $meta {
128+ * Optional. Additional metadata for the ability.
129+ *
130+ * @type array<string,bool|string> $annotations Optional. Annotation metadata for the ability.
131+ * @type bool $show_in_rest Optional. Whether to expose this ability in the REST API. Default false.
132+ * }
133+ * }
98134 * @param string $name The name of the ability, with its namespace.
99135 */
100136 $ args = apply_filters ( 'register_ability_args ' , $ args , $ name );
0 commit comments