|
132 | 132 | * |
133 | 133 | * Ability names must follow these rules: |
134 | 134 | * |
135 | | - * - Contain 2 to 4 segments separated by forward slashes |
136 | | - * (e.g., `my-plugin/my-ability`, `my-plugin/resource/find`, `my-plugin/resource/sub/find`). |
| 135 | + * - Include a namespace prefix (e.g., `my-plugin/my-ability`). |
137 | 136 | * - Use only lowercase alphanumeric characters, dashes, and forward slashes. |
138 | 137 | * - Use descriptive, action-oriented names (e.g., `process-payment`, `generate-report`). |
139 | 138 | * |
|
226 | 225 | * @see wp_register_ability_category() |
227 | 226 | * @see wp_unregister_ability() |
228 | 227 | * |
229 | | - * @param string $name The name of the ability. Must be the fully-namespaced |
230 | | - * string identifier, e.g. `my-plugin/my-ability` or `my-plugin/resource/my-ability`. |
| 228 | + * @param string $name The name of the ability. Must be a namespaced string containing |
| 229 | + * a prefix, e.g., `my-plugin/my-ability`. Can only contain lowercase |
| 230 | + * alphanumeric characters, dashes, and forward slashes. |
231 | 231 | * @param array<string, mixed> $args { |
232 | 232 | * An associative array of arguments for configuring the ability. |
233 | 233 | * |
@@ -318,7 +318,7 @@ function wp_register_ability( string $name, array $args ): ?WP_Ability { |
318 | 318 | * @see wp_register_ability() |
319 | 319 | * |
320 | 320 | * @param string $name The name of the ability to unregister, including namespace prefix |
321 | | - * (e.g., 'my-plugin/my-ability' or 'my-plugin/resource/find'). |
| 321 | + * (e.g., 'my-plugin/my-ability'). |
322 | 322 | * @return WP_Ability|null The unregistered ability instance on success, `null` on failure. |
323 | 323 | */ |
324 | 324 | function wp_unregister_ability( string $name ): ?WP_Ability { |
@@ -351,7 +351,7 @@ function wp_unregister_ability( string $name ): ?WP_Ability { |
351 | 351 | * @see wp_get_ability() |
352 | 352 | * |
353 | 353 | * @param string $name The name of the ability to check, including namespace prefix |
354 | | - * (e.g., 'my-plugin/my-ability' or 'my-plugin/resource/find'). |
| 354 | + * (e.g., 'my-plugin/my-ability'). |
355 | 355 | * @return bool `true` if the ability is registered, `false` otherwise. |
356 | 356 | */ |
357 | 357 | function wp_has_ability( string $name ): bool { |
@@ -383,7 +383,7 @@ function wp_has_ability( string $name ): bool { |
383 | 383 | * @see wp_has_ability() |
384 | 384 | * |
385 | 385 | * @param string $name The name of the ability, including namespace prefix |
386 | | - * (e.g., 'my-plugin/my-ability' or 'my-plugin/resource/find'). |
| 386 | + * (e.g., 'my-plugin/my-ability'). |
387 | 387 | * @return WP_Ability|null The registered ability instance, or `null` if not registered. |
388 | 388 | */ |
389 | 389 | function wp_get_ability( string $name ): ?WP_Ability { |
|
0 commit comments