WordPress at a glance
function is not described

WP_Customize_Setting::sanitize() public WP 3.4.0

Sanitize an input.

{} It's a method of the class: WP_Customize_Setting{}

Hooks from the method

String|Array|null|WP_Error. Sanitized value, or null/WP_Error if invalid.


$WP_Customize_Setting = new WP_Customize_Setting();
$WP_Customize_Setting->sanitize( $value );
$value(string|array) (required)
The value to sanitize.


Since 3.4.0 Introduced.

Code of WP_Customize_Setting::sanitize() WP 5.7.2

public function sanitize( $value ) {

	 * Filters a Customize setting value in un-slashed form.
	 * @since 3.4.0
	 * @param mixed                $value Value of the setting.
	 * @param WP_Customize_Setting $this  WP_Customize_Setting instance.
	return apply_filters( "customize_sanitize_{$this->id}", $value, $this );