customize_sanitize_(id) filter-hookWP 3.4.0

Filters a Customize setting value in un-slashed form.

Usage

add_filter( 'customize_sanitize_(id)', 'wp_kama_customize_sanitize_id_filter', 10, 2 );

/**
 * Function for `customize_sanitize_(id)` filter-hook.
 * 
 * @param mixed                $value   Value of the setting.
 * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
 *
 * @return mixed
 */
function wp_kama_customize_sanitize_id_filter( $value, $setting ){

	// filter...
	return $value;
}
$value(mixed)
Value of the setting.
$setting(WP_Customize_Setting)
WP_Customize_Setting instance.

Changelog

Since 3.4.0 Introduced.

Where the hook is called

WP_Customize_Setting::sanitize()
customize_sanitize_(id)
WP_Customize_Nav_Menu_Item_Setting::sanitize()
customize_sanitize_(id)
WP_Customize_Nav_Menu_Setting::sanitize()
customize_sanitize_(id)
wp-includes/class-wp-customize-setting.php 576
return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php 740
return apply_filters( "customize_sanitize_{$this->id}", $menu_item_value, $this );
wp-includes/customize/class-wp-customize-nav-menu-setting.php 444
return apply_filters( "customize_sanitize_{$this->id}", $value, $this );

Where the hook is used in WordPress

wp-includes/class-wp-customize-nav-menus.php 733
remove_filter( "customize_sanitize_{$setting_id}", 'absint' );
wp-includes/class-wp-customize-nav-menus.php 734
add_filter( "customize_sanitize_{$setting_id}", array( $this, 'intval_base10' ) );
wp-includes/class-wp-customize-setting.php 203
add_filter( "customize_sanitize_{$this->id}", $this->sanitize_callback, 10, 2 );
wp-includes/class-wp-customize-setting.php 206
add_filter( "customize_sanitize_js_{$this->id}", $this->sanitize_js_callback, 10, 2 );