Title: wp_ability_validate_input
Published: August 20, 2026

---

# apply_filters( ‘wp_ability_validate_input’, true|WP_Error $is_valid, mixed $input, string $ability_name )

## In this article

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

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

Filters the input validation result for an ability.

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

Allows developers to add custom validation logic on top of the default JSON Schema
validation. If default validation already failed, the filter receives the [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)
object and can add additional error information or override it. If default validation
passed, the filter can add additional validation checks and return a [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)
if those checks fail.

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

 `$is_valid`true|[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)

The validation result from default validation.

`$input`mixed

The input data being validated.

`$ability_name`string

The name of the ability.

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

    ```php
    $validity = apply_filters( 'wp_ability_validate_input', $is_valid, $input, $this->name );
    ```

[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#L566)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/abilities-api/class-wp-ability.php#L566-L566)

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

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

Validates input data against the input schema.

  |

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