WP_Customize_Setting::sanitize( string|array $value ): string|array|null|WP_Error

In this article

Sanitize an input.

Parameters

$valuestring|arrayrequired
The value to sanitize.

Return

string|array|null|WP_Error Sanitized value, or null/WP_Error if invalid.

Source

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 $setting WP_Customize_Setting instance.
	 */
	return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
}

Hooks

apply_filters( “customize_sanitize_{$this->id}”, mixed $value, WP_Customize_Setting $setting )

Filters a Customize setting value in un-slashed form.

Changelog

VersionDescription
3.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.