json['value'] = $this->value(); $this->json[ 'link' ] = $this->get_link(); $this->json[ 'id' ] = $this->id; if( empty( $this->value() ) ){ $this->json[ 'sections' ] = $this->choices; }else{ $saved = array(); $val = json_decode( $this->value() ); foreach ( $val as $v ) { $saved[ $v ] = $this->choices[ $v ]; } if( !empty( $saved ) ){ $this->json[ 'sections' ] = $saved; }else{ $this->json[ 'sections' ] = $this->choices; } } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @access protected * @since 1.0.0 * * @package BizSmart Theme */ protected function content_template() { ?>