json['label'] ) ) { $this->json['label'] = html_entity_decode( $this->json['label'] ); } if ( isset( $this->json['description'] ) ) { $this->json['description'] = html_entity_decode( $this->json['description'] ); } $this->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; } }