Title: customize_validate_{$this-&gt;id}
Published: August 16, 2016
Last modified: April 28, 2025

---

# apply_filters( “customize_validate_{$this->id}”, WP_Error $validity, mixed $value, WP_Customize_Setting $setting )

## In this article

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

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

Validates a Customize setting value.

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

Plugins should amend the `$validity` object via its `WP_Error::add()` method.

The dynamic portion of the hook name, `$this->ID`, refers to the setting ID.

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

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

Filtered from `true` to `WP_Error` when invalid.

`$value`mixed

Value of the setting.

`$setting`[WP_Customize_Setting](https://developer.wordpress.org/reference/classes/wp_customize_setting/)

[WP_Customize_Setting](https://developer.wordpress.org/reference/classes/wp_customize_setting/)
instance.

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

    ```php
    $validity = apply_filters( "customize_validate_{$this->id}", $validity, $value, $this );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-setting.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-customize-setting.php#L617)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-customize-setting.php#L617-L617)

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

| Used by | Description | 
| [WP_Customize_Setting::validate()](https://developer.wordpress.org/reference/classes/wp_customize_setting/validate/)`wp-includes/class-wp-customize-setting.php` |

Validates an input.

  |

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

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

## User Contributed Notes

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