[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/abilities-api/ -> class-wp-abilities-registry.php (summary)

Abilities API Defines WP_Abilities_Registry class.

File Size: 320 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions

  register()
  unregister()
  get_all_registered()
  is_registered()
  get_registered()
  get_instance()
  __wakeup()
  __sleep()

Functions
Functions that are not part of a class:

register( string $name, array $args )   X-Ref
Registers a new ability.

Do not use this method directly. Instead, use the `wp_register_ability()` function.

return: WP_Ability|null The registered ability instance on success, null on failure.
param: string               $name The name of the ability. The name must be a string containing a namespace
param: array<string, mixed> $args {

unregister( string $name )   X-Ref
Unregisters an ability.

Do not use this method directly. Instead, use the `wp_unregister_ability()` function.

return: WP_Ability|null The unregistered ability instance on success, null on failure.
param: string $name The name of the registered ability, with its namespace.

get_all_registered()   X-Ref
Retrieves the list of all registered abilities.

Do not use this method directly. Instead, use the `wp_get_abilities()` function.

return: WP_Ability[] The array of registered abilities.

is_registered( string $name )   X-Ref
Checks if an ability is registered.

Do not use this method directly. Instead, use the `wp_has_ability()` function.

return: bool True if the ability is registered, false otherwise.
param: string $name The name of the registered ability, with its namespace.

get_registered( string $name )   X-Ref
Retrieves a registered ability.

Do not use this method directly. Instead, use the `wp_get_ability()` function.

return: ?WP_Ability The registered ability instance, or null if it is not registered.
param: string $name The name of the registered ability, with its namespace.

get_instance()   X-Ref
Utility method to retrieve the main instance of the registry class.

The instance will be created if it does not exist yet.

return: WP_Abilities_Registry|null The main registry instance, or null when `init` action has not fired.

__wakeup()   X-Ref
Wakeup magic method.


__sleep()   X-Ref
Sleep magic method.




Generated : Thu Oct 23 08:20:05 2025 Cross-referenced by PHPXref