We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d7f40c commit 7708fd5Copy full SHA for 7708fd5
1 file changed
packages/wordpress-plugin/src/class-wp-codebox-abilities.php
@@ -97,6 +97,13 @@ private function register_category(): void {
97
}
98
99
$register_category = static function (): void {
100
+ // Core's `wp_abilities_api_categories_init` action can fire more than
101
+ // once per request (e.g. on multisite), so guard against re-registering
102
+ // an already-registered category to avoid a `_doing_it_wrong` notice.
103
+ if ( function_exists( 'wp_has_ability_category' ) && wp_has_ability_category( 'wp-codebox' ) ) {
104
+ return;
105
+ }
106
+
107
wp_register_ability_category(
108
'wp-codebox',
109
array(
0 commit comments