switch_type = isset($args['switch_type']) ? esc_attr($args['switch_type']) : 'radio'; parent::__construct( $manager, $id, $args ); } public function enqueue(){ wp_enqueue_style( 'dg-customizer-switch-control-css', dglib_directory_uri('assets/parts/controls/css/dg-customizer-switch-control.min.css'), array(), '1.0.0' ); wp_enqueue_script('dg-customizer-switch-control-js', dglib_directory_uri('assets/parts/controls/js/dg-customizer-switch-control.min.js'), array('jquery'), '1.0.0', false); } public function render_content(){ $switch_type = $this->switch_type; $checked_value = $this->value(); if( dglib_is_json($checked_value) ){ $checked_value = json_decode( $checked_value, false ); } ?> label ); ?>
description ); ?>
choices; foreach ( $show_choices as $key => $value ) { if(is_array($checked_value)){ $is_checked = in_array($key, $checked_value); }else{ $is_checked = ($key==$checked_value) ? true : false; } ?>
type="" value=""/>
link(); ?> />