﻿id summary reporter owner description type status priority
milestone component version severity resolution keywords cc
21918 WP_Customize_Control() doesn't work with add_setting()
default theme_mod type sebstyle "Consider the following code:
{{{ $wp_customize->add_setting($color,array( 'default' =>
'#000000', 'sanitize_callback' => 'sanitize_hex_color',
'capability' => 'edit_theme_options', 'transport' =>
'postMessage' ) ); $wp_customize->add_control(new
WP_Customize_Color_Control($wp_customize,$color,array( 'label'
=> 'somelabel', 'section' => 'colors' ) ) ); }}} The default
'type' used for add_setting() is 'theme_mod' as defined in http:
//codex.wordpress.org/Class_Reference%5CWP_Customize_Manager%5Ca
dd_setting The WP_Customize_Color_Control '''does not''' accept
the 'default' setting when there is no 'type' specified. The
WP_Customize_Color_Control '''does accept''' the 'default'
setting when 'type' is either set to 'option' or 'theme_mods'.
Setting it to 'option' makes no sense because that would imply
th