wp_unregister_ability_category()
Unregisters an ability category.
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' );
}
Хуков нет.
Возвращает
WP_Ability_Category|null. The unregistered ability category instance on success, null on failure.
Использование
wp_unregister_ability_category( $slug ): ?WP_Ability_Category;
- $slug(строка) (обязательный)
- The slug of the ability category to unregister.
Заметки
- Смотрите: WP_Ability_Categories_Registry::unregister()
- Смотрите: wp_register_ability_category()
Список изменений
| С версии 6.9.0 | Введена. |
Код wp_unregister_ability_category() wp unregister ability category WP 6.9
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 );
}