json['choices'] = wp_parse_args( $this->json['choices'], [ 'min' => 0, 'max' => 100, 'step' => 1, ] ); if ( isset( $this->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['choices']['min'] = (float) $this->json['choices']['min']; $this->json['choices']['max'] = (float) $this->json['choices']['max']; $this->json['choices']['step'] = (float) $this->json['choices']['step']; $this->json['value'] = $this->json['value'] < $this->json['choices']['min'] ? $this->json['choices']['min'] : $this->json['value']; $this->json['value'] = $this->json['value'] > $this->json['choices']['max'] ? $this->json['choices']['max'] : $this->json['value']; $this->json['value'] = (float) $this->json['value']; } /** * 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 WP_Customize_Control::to_json(). * * @see WP_Customize_Control::print_template() * * @since 1.0 */ protected function content_template() {} }