json['isClearable'] = $this->isClearable; // Backwards-compatibility: The "multiple" argument used to be a number of maximum options users can select. // That was based on select2. Since we switched to react-select this option is a boolean so we need to convert it. switch ( $this->multiple ) { case true: case false: $this->json['multiple'] = $this->multiple; // Already a bool. break; case 0: case '0': $this->json['multiple'] = true; // 0 used to be infinite. break; case 1: case '1': $this->json['multiple'] = false; // Single option. break; case ( is_numeric( $this->multiple ) && 1 < $this->multiple ): $this->json['multiple'] = true; // More than 1 options. break; default: $this->multiple = false; } $this->json['placeholder'] = ( $this->placeholder ) ? $this->placeholder : esc_html__( 'Select...', 'kirki' ); $this->json['select_args'] = $this->select_args; } /** * 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()}. * * @see WP_Customize_Control::print_template() * * @access protected * @since 1.1 * @return void */ protected function content_template() { ?>