Title: wp_pre_execute_ability
Published: August 20, 2026

---

# apply_filters( ‘wp_pre_execute_ability’, mixed $pre, string $ability_name, mixed $input, WP_Ability $ability )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#wp--skip-link--target)

Filters whether to short-circuit ability execution.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#description)󠁿

Returning a value other than the received default bypasses the rest of `execute()`—
input normalization, input validation, permission checks, the registered execute
callback, output validation, and the surrounding actions — and the value is returned
to the caller as-is. Useful for cached responses, rate limiting, maintenance mode,
and test mocking.

To continue with normal execution, return `$pre` unchanged. This preserves any value(
including `null`, `false`, or arbitrary objects) as a valid short-circuit result.

Because validation is bypassed, callers that short-circuit are responsible for the
integrity of any value they consume from `$input`.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#parameters)󠁿

 `$pre`mixed

The pre-computed result. Return this value unchanged to continue execution.
 Default`
WP_Filter_Sentinel` instance unique to this invocation.

`$ability_name`string

The name of the ability.

`$input`mixed

The raw input passed to `execute()`.

`$ability`[WP_Ability](https://developer.wordpress.org/reference/classes/wp_ability/)

The ability instance.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#source)󠁿

    ```php
    $pre = apply_filters( 'wp_pre_execute_ability', $pre_execute_sentinel, $this->name, $input, $this );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/abilities-api/class-wp-ability.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/abilities-api/class-wp-ability.php#L809)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/abilities-api/class-wp-ability.php#L809-L809)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Ability::execute()](https://developer.wordpress.org/reference/classes/wp_ability/execute/)`wp-includes/abilities-api/class-wp-ability.php` |

Executes the ability after input validation and running a permission check.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_pre_execute_ability%2F)
before being able to contribute a note or feedback.