json['multi'] = $this->multi; $this->json['choices'] = $this->choices; $this->json['selected'] = $this->value(); } /** * Don't render any content for this control from PHP. * * @see Barter_A13_Customize_Button_Set_Control::content_template() */ public function render_content() {} /** * Render a JS template for the content of the button_set control. * */ public function content_template() { ?> <# var is_multi = data.multi; var id = data.settings.default; var input_type = is_multi ? 'checkbox' : 'radio'; #> <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>
<# _.each( data.choices, function( choice, index ) { #> checked <# } #> /> <# } ); #>