wp_get_ability_category
wp_get_ability_category ( $slug )
Parameters:- (string) slug The slug of the ability category.
See:Returns:- (WP_Ability_Category|null) The ability category instance, or `null` if not registered.
Defined at: - Introduced in WordPress: 6.9.0
- Deprecated in WordPress: —
Description
Retrieves a registered ability category.Returns the ability category instance for inspection or use. The instance provides access
to the ability category's configuration and metadata.
Example:
// Prints information about a registered ability category.
$ability_category = wp_get_ability_category( 'content-management' );
if ( $ability_category ) {
echo $ability_category->get_label() . ': ' . $ability_category->get_description();
}