json['choicesLength'] = 0; if ( is_array( $this->choices ) && count( $this->choices ) ) { $this->json['choicesLength'] = count( $this->choices ); } $values = $this->value() == '' ? array_keys( $this->choices ) : $this->value(); $filtered_values = array(); if ( is_array( $values ) && ! empty( $values ) ) { foreach ( $values as $key => $value ) { if ( array_key_exists( $value, $this->choices ) ) { $filtered_values[ $key ] = $value; } } } $this->json['filteredValues'] = $filtered_values; $this->json['invisibleKeys'] = array_diff( array_keys( $this->choices ), $filtered_values ); $this->json['inputAttrs'] = maybe_serialize( $this->input_attrs() ); } /** * 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 Kirki_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?> <# if ( ! data.choicesLength ) return; #> <# if ( data.tooltip ) { #> <# } #>