wp_ability_invoked action-hookWP 7.1.0

Fires when an ability is invoked, before any processing takes place.

This action fires for every call regardless of outcome (validation failure, permission denial, short-circuit, or successful execution), and before input normalization so the raw input is captured as-is.

Usage

add_action( 'wp_ability_invoked', 'wp_kama_ability_invoked_action', 10, 3 );

/**
 * Function for `wp_ability_invoked` action-hook.
 * 
 * @param string     $ability_name The name of the ability.
 * @param mixed      $input        The raw input data for the ability, before normalization.
 * @param WP_Ability $ability      The ability instance.
 *
 * @return void
 */
function wp_kama_ability_invoked_action( $ability_name, $input, $ability ){
	// action...
}
$ability_name(string)
The name of the ability.
$input(mixed)
The raw input data for the ability, before normalization.
$ability(WP_Ability)
The ability instance.

Changelog

Since 7.1.0 Introduced.

Where the hook is called

WP_Ability::execute()
wp_ability_invoked
wp-includes/abilities-api/class-wp-ability.php 783
do_action( 'wp_ability_invoked', $this->name, $input, $this );

Where the hook is used in WordPress

Usage not found.