'radio_image_box', 'options' => array( 'image-1' => plugins_url('../assets/images/patterns/01.png',__FILE__), 'image-2' => plugins_url('../assets/images/patterns/12.png',__FILE__), ), 'useextension' => false, // if false it will use key as value instead file name. Eg - "image-1" instead "01.png" 'css' => array( 'width' => '40px', 'height' => '35px', 'background-repeat' => 'repeat', 'background-size' => 'cover' ), ) */ if(!class_exists('Ultimate_Radio_Image_Param')) { class Ultimate_Radio_Image_Param { function __construct() { if(defined('WPB_VC_VERSION') && version_compare(WPB_VC_VERSION, 4.8) >= 0) { if(function_exists('vc_add_shortcode_param')) { vc_add_shortcode_param('radio_image_box' , array(&$this, 'radio_image_settings_field' ) ); } } else { if(function_exists('add_shortcode_param')) { add_shortcode_param('radio_image_box' , array(&$this, 'radio_image_settings_field' ) ); } } } function radio_image_settings_field($settings, $value) { $default_css = array( 'width' => '25px', 'height' => '25px', 'background-repeat' => 'repeat', 'background-size' => 'cover' ); $dependency = ''; $param_name = isset($settings['param_name']) ? $settings['param_name'] : ''; $type = isset($settings['type']) ? $settings['type'] : ''; $options = isset($settings['options']) ? $settings['options'] : ''; $css = isset($settings['css']) ? $settings['css'] : $default_css; $class = isset($settings['class']) ? $settings['class'] : ''; $useextension = (isset($settings['useextension']) && $settings['useextension'] != '' ) ? $settings['useextension'] : 'true'; $default = isset($settings['default']) ? $settings['default'] : 'transperant'; $uni = uniqid(); $output = ''; $output = ''; $output .= '
'; if($value == 'transperant') $checked = 'checked'; else $checked = ''; $output .= ''; foreach($options as $key => $img_url) { if($value == $key) $checked = 'checked'; else $checked = ''; if($useextension != 'true') { $temp = pathinfo($key); $temp_filename = $temp['filename']; $key = $temp_filename; } $output .= ''; } $output .= '
'; $output .= ''; $output .= ''; return $output; } } } if(class_exists('Ultimate_Radio_Image_Param')) { $Ultimate_Radio_Image_Param = new Ultimate_Radio_Image_Param(); }