Unregisters an ability category.
Description
Removes a previously registered ability category from the global registry. Use this to disable ability categories that are no longer needed.
Can be called at any time after the ability category has been registered.
Example:
if ( wp_has_ability_category( 'deprecated-category' ) ) {
wp_unregister_ability_category( 'deprecated-category' );
}
See also
Parameters
$slugstringrequired- The slug of the ability category to unregister.
Source
function wp_unregister_ability_category( string $slug ): ?WP_Ability_Category {
$registry = WP_Ability_Categories_Registry::get_instance();
if ( null === $registry ) {
return null;
}
return $registry->unregister( $slug );
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.