register_control_type( 'Epsilon_Control_Button_Group' ); } /** * Add custom parameters to pass to the JS via JSON. * * @since 1.1.0 * @access public */ public function json() { $json = parent::json(); $json['id'] = $this->id; $json['link'] = $this->get_link(); $json['value'] = $this->value(); $json['default'] = $this->default; $json['choices'] = $this->choices; $json['groupType'] = $this->set_group_type(); $this->json['inputAttrs'] = ''; foreach ( $this->input_attrs as $attr => $value ) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; } return $json; } /** * Set group type */ public function set_group_type() { $arr = array( 0 => 'none', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', ); return $arr[ count( $this->choices ) ]; } /** * Display the control's content */ public function content_template() { //@formatter:off ?>
<# } #>
<# } #>