apply_filters( "customize_validate_{$this->id}", WP_Error $validity, mixed $value, WP_Customize_Setting $setting )
- Since
- 4.6.0
Validates a Customize setting value.
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.
Compatibility
- WordPress
- since 4.6.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$validityWP_Error- Filtered from
truetoWP_Errorwhen invalid. $valuemixed- Value of the setting.
$settingWP_Customize_Setting- WP_Customize_Setting instance.
Where this hook fires · 1
wp-includes/class-wp-customize-setting.php:617WP_Customize_Setting::validate()
Source code
* @since 4.6.0 * * @param WP_Error $validity Filtered from `true` to `WP_Error` when invalid. * @param mixed $value Value of the setting. * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ $validity = apply_filters( "customize_validate_{$this->id}", $validity, $value, $this ); if ( is_wp_error( $validity ) && ! $validity->has_errors() ) { $validity = true; } return $validity; }Changelog
Introduced in 4.6.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.