2020 *
2121 * @see WP_Abilities_Registry::register()
2222 *
23- * @param string $name The name of the ability. The name must be a string containing a namespace
24- * prefix, i.e. `my-plugin/my-ability`. It can only contain lowercase
25- * alphanumeric characters, dashes and the forward slash.
26- * @param array<string,mixed> $args {
23+ * @param string $name The name of the ability. The name must be a string containing a namespace
24+ * prefix, i.e. `my-plugin/my-ability`. It can only contain lowercase
25+ * alphanumeric characters, dashes and the forward slash.
26+ * @param array<string, mixed> $args {
2727 * An associative array of arguments for the ability.
2828 *
29- * @type string $label The human-readable label for the ability.
30- * @type string $description A detailed description of what the ability does.
31- * @type string $category The category slug this ability belongs to.
32- * @type callable $execute_callback A callback function to execute when the ability is invoked.
33- * Receives optional mixed input and returns mixed result or WP_Error.
34- * @type callable $permission_callback A callback function to check permissions before execution.
35- * Receives optional mixed input and returns bool or WP_Error.
36- * @type array<string,mixed> $input_schema Optional. JSON Schema definition for the ability's input.
37- * @type array<string,mixed> $output_schema Optional. JSON Schema definition for the ability's output.
38- * @type array<string,mixed> $meta {
29+ * @type string $label The human-readable label for the ability.
30+ * @type string $description A detailed description of what the ability does.
31+ * @type string $category The category slug this ability belongs to.
32+ * @type callable $execute_callback A callback function to execute when the ability is invoked.
33+ * Receives optional mixed input and returns mixed result or WP_Error.
34+ * @type callable $permission_callback A callback function to check permissions before execution.
35+ * Receives optional mixed input and returns bool or WP_Error.
36+ * @type array<string, mixed> $input_schema Optional. JSON Schema definition for the ability's input.
37+ * @type array<string, mixed> $output_schema Optional. JSON Schema definition for the ability's output.
38+ * @type array<string, mixed> $meta {
3939 * Optional. Additional metadata for the ability.
4040 *
41- * @type array<string,bool|string> $annotations Optional. Annotation metadata for the ability.
42- * @type bool $show_in_rest Optional. Whether to expose this ability in the REST API. Default false.
41+ * @type array<string, bool|string> $annotations Optional. Annotation metadata for the ability.
42+ * @type bool $show_in_rest Optional. Whether to expose this ability in the REST API. Default false.
4343 * }
44- * @type string $ability_class Optional. Custom class to instantiate instead of WP_Ability.
44+ * @type string $ability_class Optional. Custom class to instantiate instead of WP_Ability.
4545 * }
4646 * @return WP_Ability|null An instance of registered ability on success, null on failure.
4747 *
4848 * @phpstan-param array{
4949 * label?: string,
5050 * description?: string,
5151 * category?: string,
52- * execute_callback?: callable( mixed $input= ): (mixed|\ WP_Error),
53- * permission_callback?: callable( mixed $input= ): (bool|\ WP_Error),
54- * input_schema?: array<string,mixed>,
55- * output_schema?: array<string,mixed>,
52+ * execute_callback?: callable( mixed $input= ): (mixed|WP_Error),
53+ * permission_callback?: callable( mixed $input= ): (bool|WP_Error),
54+ * input_schema?: array<string, mixed>,
55+ * output_schema?: array<string, mixed>,
5656 * meta?: array{
57- * annotations?: array<string,(bool|string)>,
57+ * annotations?: array<string, (bool|string)>,
5858 * show_in_rest?: bool,
59- * ...<string,mixed>,
59+ * ...<string, mixed>,
6060 * },
61- * ability_class?: class-string<\ WP_Ability>,
61+ * ability_class?: class-string<WP_Ability>,
6262 * ...<string, mixed>
6363 * } $args
6464 */
@@ -115,7 +115,7 @@ function wp_get_ability( string $name ): ?WP_Ability {
115115 *
116116 * @see WP_Abilities_Registry::get_all_registered()
117117 *
118- * @return \ WP_Ability[] The array of registered abilities.
118+ * @return WP_Ability[] The array of registered abilities.
119119 */
120120function wp_get_abilities (): array {
121121 return WP_Abilities_Registry::get_instance ()->get_all_registered ();
@@ -128,21 +128,21 @@ function wp_get_abilities(): array {
128128 *
129129 * @see WP_Abilities_Category_Registry::register()
130130 *
131- * @param string $slug The unique slug for the category. Must contain only lowercase
132- * alphanumeric characters and dashes.
133- * @param array<string,mixed> $args {
131+ * @param string $slug The unique slug for the category. Must contain only lowercase
132+ * alphanumeric characters and dashes.
133+ * @param array<string, mixed> $args {
134134 * An associative array of arguments for the category.
135135 *
136136 * @type string $label The human-readable label for the category.
137137 * @type string $description A description of the category.
138- * @type array<string,mixed> $meta Optional. Additional metadata for the category.
138+ * @type array<string, mixed> $meta Optional. Additional metadata for the category.
139139 * }
140140 * @return WP_Ability_Category|null The registered category instance on success, null on failure.
141141 *
142142 * @phpstan-param array{
143143 * label: string,
144144 * description: string,
145- * meta?: array<string,mixed>,
145+ * meta?: array<string, mixed>,
146146 * ...<string, mixed>
147147 * } $args
148148 */
@@ -185,7 +185,7 @@ function wp_get_ability_category( string $slug ): ?WP_Ability_Category {
185185 *
186186 * @see WP_Abilities_Category_Registry::get_all_registered()
187187 *
188- * @return \ WP_Ability_Category[] The array of registered categories.
188+ * @return WP_Ability_Category[] The array of registered categories.
189189 */
190190function wp_get_ability_categories (): array {
191191 return WP_Abilities_Category_Registry::get_instance ()->get_all_registered ();
0 commit comments