customize_validate_(id) filter-hook . WP 4.6.0
Validates a Customize setting value.
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.
Usage
add_filter( 'customize_validate_(id)', 'filter_function_name_5285', 10, 3 ); function filter_function_name_5285( $validity, $value, $this ){ // filter... return $validity; }
- $validity(WP_Error)
- Filtered from true to WP_Error when invalid.
- $value(mixed)
- Value of the setting.
- $this(WP_Customize_Setting)
- WP_Customize_Setting instance.
Changelog
Since 4.6.0 | Introduced. |
Where the hook is called
customize_validate_(id)
wp-includes/class-wp-customize-setting.php 610
$validity = apply_filters( "customize_validate_{$this->id}", $validity, $value, $this );
Where in WP core the hook is used WordPress
wp-includes/class-wp-customize-setting.php 199
add_filter( "customize_validate_{$this->id}", $this->validate_callback, 10, 3 );