wp_before_execute_ability хук-событиеWP 6.9.0

Fires before an ability gets executed, after input validation and permissions check.

Использование

add_action( 'wp_before_execute_ability', 'wp_kama_before_execute_ability_action', 10, 3 );

/**
 * Function for `wp_before_execute_ability` action-hook.
 * 
 * @param string     $ability_name The name of the ability.
 * @param mixed      $input        The input data for the ability.
 * @param WP_Ability $ability      The ability instance.
 *
 * @return void
 */
function wp_kama_before_execute_ability_action( $ability_name, $input, $ability ){
	// action...
}
$ability_name(строка)
The name of the ability.
$input(разное)
The input data for the ability.
$ability(WP_Ability)
The ability instance.

Список изменений

С версии 6.9.0 Введена.
С версии 7.1.0 Added the $ability parameter.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.