Title: wp_ability_execute_result
Published: August 20, 2026

---

# apply_filters( ‘wp_ability_execute_result’, mixed $result, string $ability_name, mixed $input, WP_Ability $ability )

## In this article

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

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

Filters the result returned by an ability’s execute callback.

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

Fires after the registered execute callback runs. Plugins can use this to transform
the result — response formatting, stripping internal metadata, content safety filtering,
response enrichment, or recovering from a failure by returning a successful value.

The filter receives whatever the registered callback produced, including a `WP_Error`
if execution failed. Filters may pass the `WP_Error` through unchanged, override
it with a recovered result, or convert a successful result into a `WP_Error`.

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

 `$result`mixed

The result returned by the registered `execute_callback`, or a `WP_Error` if execution
failed.

`$ability_name`string

The name of the ability.

`$input`mixed

The normalized input data.

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

The ability instance.

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

    ```php
    return apply_filters( 'wp_ability_execute_result', $result, $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#L701)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/abilities-api/class-wp-ability.php#L701-L701)

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

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

Executes the ability callback.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_ability_execute_result/?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_ability_execute_result%2F)
before being able to contribute a note or feedback.