wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_has_ability › WordPress Function

Since6.9.0
Deprecatedn/a
wp_has_ability ( $name )
Parameters:
  • (string) $name The name of the registered ability, with its namespace.
    Required: Yes
See:
  • WP_Abilities_Registry::is_registered()
Returns:
  • (bool) True if the ability is registered, false otherwise.
Defined at:
Codex:

Checks if an ability is registered.



Source

function wp_has_ability( string $name ): bool {
	$registry = WP_Abilities_Registry::get_instance();
	if ( null === $registry ) {
		return false;
	}

	return $registry->is_registered( $name );
}