= 0) { if(function_exists('vc_add_shortcode_param')) { vc_add_shortcode_param('prime_switch' , array($this, 'checkbox_param')); } } else { if(function_exists('add_shortcode_param')) { add_shortcode_param('prime_switch' , array($this, 'checkbox_param')); } } } function checkbox_param($settings, $value){ $dependency = ''; $param_name = isset($settings['param_name']) ? $settings['param_name'] : ''; $type = isset($settings['type']) ? $settings['type'] : ''; $options = isset($settings['options']) ? $settings['options'] : ''; $class = isset($settings['class']) ? $settings['class'] : ''; $default_set = isset($settings['default_set']) ? $settings['default_set'] : false; $output = $checked = ''; $un = uniqid('ultswitch-'.rand()); if(is_array($options) && !empty($options)){ foreach($options as $key => $opts){ if($value == $key){ $checked = "checked"; } else { $checked = ""; } $uid = uniqid('ultswitchparam-'.rand()); $output .= '
'; if(isset($opts['label'])) $lbl = $opts['label']; else $lbl = ''; $output .= '
'.$lbl.'

'; } } if($default_set) $set_value = 'off'; else $set_value = ''; //$output .= ''; $output .= ''; return $output; } } } // Finally initialize code new prime_Switch_Param;