customize_validate_{$this->id} WordPress Filter Hook

The customize_validate_{$this->id} hook is called when the Customizer settings are saved. This hook can be used to validate the settings and to set any error messages.

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

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.


Top ↑

Parameters

$validity

(WP_Error)Filtered from true to WP_Error when invalid.

$value

(mixed)Value of the setting.

$setting

(WP_Customize_Setting)WP_Customize_Setting instance.


Top ↑

Source

File: wp-includes/class-wp-customize-setting.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.