Returns the ability instance for inspection or use. The instance provides access to the ability's configuration, metadata, and execution methods. Example: // Prints information about a registered ability.
$ability = wp_get_ability( 'my-plugin/export-data' );
if ( $ability ) {
echo $ability->get_label() . ': ' . $ability->get_description();
}
Parameters
$namestring
The name of the ability, including namespace prefix (e.g., 'my-plugin/my-ability').
Return
WP_Ability|null
The registered ability instance, or null if not registered.
Signature, return type and hooks compared across 3 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/abilities-api.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.