wppaste
WordPress

do_action( 'wp_before_execute_ability', string $ability_name, mixed $input, WP_Ability $ability )

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

Compatibility

WordPress
since 7.1.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 7.1.0.

Parameters

$ability_namestring
The name of the ability.
$inputmixed
The input data for the ability.
$abilityWP_Ability
The ability instance.

Where this hook fires · 1

  • wp-includes/abilities-api/class-wp-ability.php:852WP_Ability::execute()

Source code

		 * @since 7.1.0 Added the `$ability` parameter.		 *		 * @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.		 */		do_action( 'wp_before_execute_ability', $this->name, $input, $this ); 		$result = $this->do_execute( $input );		if ( is_wp_error( $result ) ) {			return $result;		}

Changelog

Introduced in 6.9.0. One change between 6.9.7 and 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.

7.1.0
Parameter $ability added.verified against source
7.1.0
Added the $ability parameter.from the docblock
6.9.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, 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.