Skip to content

Instantly share code, notes, and snippets.

@Otto42
Created September 20, 2013 15:40
Show Gist options
  • Save Otto42/6639477 to your computer and use it in GitHub Desktop.
Save Otto42/6639477 to your computer and use it in GitHub Desktop.
How to set the color picker and the control in the customizer via JS
control = wp.customize.control.instance('header_textcolor');
picker = control.container.find('.color-picker-hex');
control.setting.set('#FFFFFF');
picker.wpColorPicker('color', control.setting() );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment