wppaste
WordPress

WP_Ability

Since
6.9.0
Source
wp-includes/abilities-api/class-wp-ability.php:21
Encapsulates the properties and methods related to a specific ability in the registry.

Compatibility

WordPress
since 6.9.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in 3 of the 5 tracked releases, added in 6.9.0.

Hooks and filters fired · 9

Every hook that fires from inside WP_Ability, in the order it appears in the class, grouped by the method that fires it.

Properties · 10

$default_annotationsarray<string,protected static
The default ability annotations.
$namestringprotected
The name of the ability, with its namespace.
$labelstringprotected
The human-readable ability label.
$descriptionstringprotected
The detailed ability description.
$categorystringprotected
The ability category.
$input_schemaarray<string,protected
The optional ability input schema.
$output_schemaarray<string,protected
The optional ability output schema.
$execute_callbackcallable(mixed):protected
The ability execute callback.
$permission_callbackcallable(mixed):protected
The optional ability permission callback.
$metaarray<string,protected
The optional ability metadata.

Methods · 19

Source code

class WP_Ability { 	/**	 * The default value for the `show_in_rest` meta.	 *	 * @since 6.9.0	 * @var bool	 */	protected const DEFAULT_SHOW_IN_REST = false; 	/**	 * The default value for the `public` meta.	 *	 * @since 7.1.0	 * @var bool	 */	protected const DEFAULT_PUBLIC = false; 	/**	 * The default ability annotations.	 * They are not guaranteed to provide a faithful description of ability behavior.	 *	 * @since 6.9.0	 * @var array<string, bool|null>	 */	protected static $default_annotations = array(		// If true, the ability does not modify its environment.		'readonly'    => null,		/*		 * If true, the ability may perform destructive updates to its environment.		 * If false, the ability performs only additive updates.		 */		'destructive' => null,		/*		 * If true, calling the ability repeatedly with the same arguments will have no additional effect		 * on its environment.		 */		'idempotent'  => null,	); 	/**	 * The name of the ability, with its namespace.	 * Example: `my-plugin/my-ability`.	 *	 * @since 6.9.0	 * @var string	 */	protected $name; 	/**	 * The human-readable ability label.	 *	 * @since 6.9.0	 * @var string	 */	protected $label; 	/**	 * The detailed ability description.	 *	 * @since 6.9.0	 * @var string	 */	protected $description; 	/**	 * The ability category.	 *	 * @since 6.9.0	 * @var string	 */	protected $category; 	/**	 * The optional ability input schema.	 *	 * @since 6.9.0	 * @var array<string, mixed>	 */	protected $input_schema = array();

Changelog

Introduced in 6.9.0. Unchanged from 6.9.7 through 7.1.0.

  1. 6.9.7
  2. 7.0.4
  3. 7.1.0

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/class-wp-ability.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.