| @@ -440,8 +440,22 @@ | ||
| 440 | 440 | return $described; |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | /** |
| 444 | + * @return array - The name a client calls each registered ability by. | |
| 445 | + */ | |
| 446 | + public static function abilityNames() | |
| 447 | + { | |
| 448 | + if (!function_exists('wp_get_abilities')) { | |
| 449 | + return []; | |
| 450 | + } | |
| 451 | + | |
| 452 | + return array_values(array_map(function ($ability) { | |
| 453 | + return self::name($ability->get_name()); | |
| 454 | + }, \wp_get_abilities())); | |
| 455 | + } | |
| 456 | + | |
| 457 | + /** | |
| 444 | 458 | * @param string $subject - The ability name. |
| 445 | 459 | * @return string |
| 446 | 460 | */ |
| 447 | 461 | private static function name($subject) |