Skip to content

Commit 8dd04fb

Browse files
committed
Abilities API: Ensure public method is used in the codebase
Discovered when syncing code back to Abilities API repository in WordPress/abilities-api#126. Follow-up to [61032]. See #64098. git-svn-id: https://develop.svn.wordpress.org/trunk@61059 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ceae14b commit 8dd04fb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/wp-includes/abilities-api/class-wp-abilities-registry.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ public function register( string $name, array $args ): ?WP_Ability {
121121

122122
// Validate ability category exists if provided (will be validated as required in WP_Ability).
123123
if ( isset( $args['category'] ) ) {
124-
$category_registry = WP_Ability_Categories_Registry::get_instance();
125-
if ( ! $category_registry->is_registered( $args['category'] ) ) {
124+
if ( ! wp_has_ability_category( $args['category'] ) ) {
126125
_doing_it_wrong(
127126
__METHOD__,
128127
sprintf(

0 commit comments

Comments
 (0)