WordPress Hooks Explorer

Listing all hooks extracted WordPress Core


Details about customize_validate_

Back to home

Files

Filename Hook Type Line Number PHP Doc
wp-includes/class-wp-customize-setting.php apply_filters 612 /**
* 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.
*
* @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.
*/
wp-includes/class-wp-customize-manager.php apply_filters 2366 /**
* Validates setting values.
*
* Validation is skipped for unregistered settings or for values that are
* already null since they will be skipped anyway. Sanitization is applied
* to values that pass validation, and values that become null or `WP_Error`
* after sanitizing are marked invalid.
*
* @since 4.6.0
*
* @see WP_REST_Request::has_valid_params()
* @see WP_Customize_Setting::validate()
*
* @param array $setting_values Mapping of setting IDs to values to validate and sanitize.
* @param array $options {
* Options.
*
* @type bool $validate_existence Whether a setting's existence will be checked.
* @type bool $validate_capability Whether the setting capability will be checked.
* }
* @return array Mapping of setting IDs to return value of validate method calls, either `true` or `WP_Error`.
*/

Hook Parameters

Parameter Type Name Description
WP_Error $validity Filtered from `true` to `WP_Error` when invalid.
mixed $value Value of the setting.
WP_Customize_Setting $setting WP_Customize_Setting instance.