Beispiel #1
0
 public function init_shortcodes()
 {
     $min = defined('WP_DEBUG') && WP_DEBUG ? '' : '.min';
     WpbakeryShortcodeParams::addField('wyde_animation', array($this, 'animation_field'), get_template_directory_uri() . '/shortcodes/js/wyde-animation' . $min . '.js');
     WpbakeryShortcodeParams::addField('wyde_gmaps', array($this, 'gmaps_field'), get_template_directory_uri() . '/shortcodes/js/wyde-gmaps' . $min . '.js');
     $this->add_elements();
     $this->update_elements();
 }
    $type = isset($settings['type']) ? $settings['type'] : '';
    $class = isset($settings['class']) ? $settings['class'] : '';
    $output = '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . esc_attr($value) . '" ' . $dependency . ' />';
    $placeholder = isset($settings['placeholder']) ? $settings['placeholder'] : esc_html__('Search icon ...', 'adroit');
    $output .= '<div class="param-icon-header clearfix">';
    $preview_class = $value ? 'active' : '';
    $output .= '<span class="param-icon-preview ' . $preview_class . '"><i class="' . $value . '"></i><span class="icon-preview-remove"></span></span>';
    $output .= '<p><input type="text" placeholder="' . $placeholder . '" name="param-icon-search" class="param-icon-search" /></p>';
    $lists = apply_filters('kt_icons_source', array());
    if (is_array($lists)) {
        $icons = '';
        $output .= '<p><select name="param-icon-categories" class="param-icon-categories">';
        $output .= '<option value="">' . esc_html__('From all categories', 'adroit') . '</option>';
        foreach ($lists as $k => $v) {
            $text = ucwords(str_replace('_', ' ', $k));
            $output .= '<option value="' . $k . '">' . $text . '</option>';
            foreach ($v as $icon) {
                foreach ($icon as $key => $label) {
                    $current = $value == $key ? 'current' : '';
                    $icons .= '<li data-source="' . $k . '" class="' . $current . '" data-key="' . $key . '"><i class="' . $key . '" title="' . $label . '"></i></li>';
                }
            }
        }
        $output .= '</select></p>';
    }
    $output .= '</div>';
    $output .= '<ul class="clearfix">' . $icons . '</ul>';
    return $output;
}
WpbakeryShortcodeParams::addField('kt_icons', 'kt_icons_settings_field', KT_FW_JS . 'kt_icons.js');
Beispiel #3
0
/**
 * Helper function to register new shortcode attribute hook.
 *
 * @param $name - attribute name
 * @param $form_field_callback - hook, will be called when settings form is shown and attribute added to shortcode
 *     param list
 * @param $script_url - javascript file url which will be attached at the end of settings form.
 *
 * @since 4.4
 * @return bool
 */
function vc_add_shortcode_param($name, $form_field_callback, $script_url = null)
{
    return WpbakeryShortcodeParams::addField($name, $form_field_callback, $script_url);
}
Beispiel #4
0
 function add_extra_field($name, $form_field_callback, $script_url = null)
 {
     return WpbakeryShortcodeParams::addField($name, $form_field_callback, $script_url);
     // $check =  WpbakeryShortcodeParams::addField( $name, $form_field_callback, $script_url );
     //  print_r($check);die();
 }
    $output .= '<p><input type="text" placeholder="' . $placeholder . '" name="param-icon-search" class="param-icon-search" /></p>';
    $lists = apply_filters('cruxstore_icons_source', array());
    if (is_array($lists)) {
        $icons = '';
        $output .= '<p><select name="param-icon-categories" class="param-icon-categories">';
        $output .= '<option value="">' . esc_html__('From all categories', 'cruxstore') . '</option>';
        foreach ($lists as $k => $v) {
            $text = ucwords(str_replace('_', ' ', $k));
            $output .= '<option value="' . $k . '">' . $text . '</option>';
            foreach ($v as $icon) {
                foreach ($icon as $key => $label) {
                    $current = $value == $key ? 'current' : '';
                    $icons .= '<li data-source="' . $k . '" class="' . $current . '" data-key="' . $key . '"><i class="' . $key . '" title="' . $label . '"></i></li>';
                }
            }
        }
        $output .= '</select></p>';
    }
    $output .= '</div>';
    $output .= '<ul class="clearfix">' . $icons . '</ul>';
    return $output;
}
WpbakeryShortcodeParams::addField('cruxstore_icons', 'cruxstore_icons_settings_field', CRUXSTORE_FW_JS . 'icons.js');
function cruxstore_preview_settings_field($settings, $value)
{
    $output = '<p class="preview-position-center"><button class="button button-second preview-position"><i class="fa fa-eye" aria-hidden="true"></i></button></p>';
    $output .= '<div class="preview-position-content"><div class="preview-position-image"></div><div class="preview-position-text"></div></div>';
    return $output;
}
WpbakeryShortcodeParams::addField('cruxstore_preview', 'cruxstore_preview_settings_field', CRUXSTORE_FW_JS . 'preview.js');
Beispiel #6
0
            }
        }
        $classes[] = $icon;
        $output = sprintf('<a title="%2$s" target="%4$s" href="%1$s" class="%3$s"><i class="fa fa-%3$s"></i></a>', $url, esc_attr($title), esc_attr(implode(' ', $classes)), $target);
        return $output;
    }
}
// presscore_get_social_icon
if (!function_exists('vc_taxonomy_form_field')) {
    function vc_taxonomy_form_field($settings, $value)
    {
        $terms_fields = array();
        $terms_slugs = array();
        $value_arr = $value;
        if (!is_array($value_arr)) {
            $value_arr = array_map('trim', explode(',', $value_arr));
        }
        if (!empty($settings['taxonomy'])) {
            $terms = get_terms($settings['taxonomy']);
            if ($terms && !is_wp_error($terms)) {
                foreach ($terms as $term) {
                    $terms_slugs[] = $term->slug;
                    $terms_fields[] = sprintf('<option id="%s" class="%s" value="%s" %s>%s</option>', $settings['param_name'] . '-' . $term->slug, $settings['param_name'] . ' ' . $settings['type'], $term->slug, selected(in_array($term->slug, $value_arr), true, false), $term->name);
                }
            }
        }
        return '<select name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select dropdown">' . '<option value=""></option>' . implode($terms_fields) . '</select>';
    }
}
WpbakeryShortcodeParams::addField('wd_taxonomy', 'vc_taxonomy_form_field');
Beispiel #7
0
    vc_map(array('name' => esc_html__('TS Products Slider', 'gon'), 'base' => 'ts_products_slider', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Content Border', 'gon'), 'param_name' => 'style_content', 'admin_label' => true, 'value' => array('Border' => 'content-border', 'No Border' => 'content-no-border'), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Product type', 'gon'), 'param_name' => 'product_type', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Columns', 'gon'), 'param_name' => 'columns', 'admin_label' => true, 'value' => 5, 'description' => esc_html__('Number of Columns', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Rows', 'gon'), 'param_name' => 'rows', 'admin_label' => true, 'value' => 1, 'description' => esc_html__('Number of Rows', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'product_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product SKU', 'gon'), 'param_name' => 'show_sku', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product short description', 'gon'), 'param_name' => 'show_short_desc', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product label', 'gon'), 'param_name' => 'show_label', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show add to cart button', 'gon'), 'param_name' => 'show_add_to_cart', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Position navigation button', 'gon'), 'param_name' => 'position_nav', 'admin_label' => true, 'value' => array('Top' => 'nav-top', 'Bottom' => 'nav-bottom'), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Margin', 'gon'), 'param_name' => 'margin', 'admin_label' => false, 'value' => '20', 'description' => esc_html__('Set margin between items', 'gon')))));
    /*** TS Products Widget ***/
    vc_map(array('name' => esc_html__('TS Products Widget', 'gon'), 'base' => 'ts_products_widget', 'class' => '', 'description' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Product type', 'gon'), 'param_name' => 'product_type', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'product_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show in a carousel slider', 'gon'), 'param_name' => 'is_slider', 'admin_label' => true, 'value' => array('No' => 0, 'Yes' => 1), 'description' => '', 'group' => 'Slider Options'), array('type' => 'textfield', 'heading' => esc_html__('Row', 'gon'), 'param_name' => 'rows', 'admin_label' => false, 'value' => 3, 'description' => esc_html__('Number of Rows for slider', 'gon'), 'group' => 'Slider Options'), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => '', 'group' => 'Slider Options'), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => '', 'group' => 'Slider Options'))));
    /*** TS Product Deals Slider ***/
    vc_map(array('name' => esc_html__('TS Product Deals Slider', 'gon'), 'base' => 'ts_product_deals_slider', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Content Border', 'gon'), 'param_name' => 'style_content', 'admin_label' => true, 'value' => array('Border' => 'content-border', 'No Border' => 'content-no-border'), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Item Layout', 'gon'), 'param_name' => 'layout', 'admin_label' => true, 'value' => array('Grid' => 'grid', 'List' => 'list'), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Columns', 'gon'), 'param_name' => 'columns', 'admin_label' => false, 'value' => 4, 'description' => esc_html__('Number of Columns', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 5, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'product_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show counter', 'gon'), 'param_name' => 'show_counter', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Counter position', 'gon'), 'param_name' => 'counter_position', 'admin_label' => false, 'value' => array('Bottom' => 'bottom', 'On thumbnail' => 'on-thumbnail'), 'description' => '', 'dependency' => array('element' => 'show_counter', 'value' => array('1'))), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product SKU', 'gon'), 'param_name' => 'show_sku', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product short description', 'gon'), 'param_name' => 'show_short_desc', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product label', 'gon'), 'param_name' => 'show_label', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show add to cart button', 'gon'), 'param_name' => 'show_add_to_cart', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Margin', 'gon'), 'param_name' => 'margin', 'admin_label' => false, 'value' => '20', 'description' => esc_html__('Set margin between items', 'gon')))));
    /*** TS Product Categories Slider ***/
    vc_map(array('name' => esc_html__('TS Product Categories Slider', 'gon'), 'base' => 'ts_product_categories_slider', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Columns', 'gon'), 'param_name' => 'columns', 'admin_label' => true, 'value' => 4, 'description' => esc_html__('Number of Columns', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 5, 'description' => esc_html__('Number of Product Categories', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Parent', 'gon'), 'param_name' => 'parent', 'admin_label' => true, 'settings' => array('multiple' => false, 'sortable' => true, 'unique_values' => true), 'value' => '', 'description' => esc_html__('Select a category. Get direct children of this category', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Child Of', 'gon'), 'param_name' => 'child_of', 'admin_label' => true, 'settings' => array('multiple' => false, 'sortable' => true, 'unique_values' => true), 'value' => '', 'description' => esc_html__('Select a category. Get all descendents of this category', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'ids', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => esc_html__('Include these categories', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Hide empty product categories', 'gon'), 'param_name' => 'hide_empty', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product category title', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Margin', 'gon'), 'param_name' => 'margin', 'admin_label' => false, 'value' => '0', 'description' => esc_html__('Set margin between items', 'gon')))));
    /*** TS Products In Category Tabs ***/
    vc_map(array('name' => esc_html__('TS Products In Category Tabs', 'gon'), 'base' => 'ts_products_in_category_tabs', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'colorpicker', 'heading' => esc_html__('Color', 'gon'), 'param_name' => 'color', 'admin_label' => true, 'value' => '#40bea7', 'description' => ''), array('type' => 'iconpicker', 'heading' => esc_html__('Icon', 'gon'), 'param_name' => 'icon_fontawesome', 'admin_label' => true, 'value' => 'fa fa-info-circle', 'settings' => array('emptyIcon' => false, 'iconsPerPage' => 4000), 'description' => esc_html__('Add this icon before the block title', 'gon')), array('type' => 'attach_image', 'heading' => esc_html__('Custom Icon', 'gon'), 'param_name' => 'icon_image', 'admin_label' => false, 'value' => '', 'description' => ''), array('type' => 'attach_images', 'heading' => esc_html__('Banners', 'gon'), 'param_name' => 'banners', 'admin_label' => false, 'value' => '', 'description' => esc_html__('Display these banners on the right side', 'gon')), array('type' => 'textarea', 'heading' => esc_html__('Links for banners', 'gon'), 'param_name' => 'links', 'admin_label' => false, 'value' => '', 'description' => esc_html__('A comma separated list of links. Ex: if you have 3 banners, the value of this field should be "link1, link2, link3"', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Product type', 'gon'), 'param_name' => 'product_type', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Columns', 'gon'), 'param_name' => 'columns', 'admin_label' => true, 'value' => 3, 'description' => esc_html__('Number of Columns', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'product_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => ''), array('type' => 'autocomplete', 'heading' => esc_html__('Parent Category', 'gon'), 'param_name' => 'parent_cat', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => false, 'sortable' => false, 'unique_values' => true), 'description' => esc_html__('Each tab will be a sub category of this category. This option is available when the Product Categories option is empty', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Include children', 'gon'), 'param_name' => 'include_children', 'admin_label' => true, 'value' => array('No' => 0, 'Yes' => 1), 'description' => esc_html__('Load the products of sub categories in each tab', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Show general tab', 'gon'), 'param_name' => 'show_general_tab', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => esc_html__('Get products from all categories or sub categories', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('General tab heading', 'gon'), 'param_name' => 'general_tab_heading', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Product type of general tab', 'gon'), 'param_name' => 'product_type_general_tab', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product SKU', 'gon'), 'param_name' => 'show_sku', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product short description', 'gon'), 'param_name' => 'show_short_desc', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product label', 'gon'), 'param_name' => 'show_label', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show add to cart button', 'gon'), 'param_name' => 'show_add_to_cart', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show see more button', 'gon'), 'param_name' => 'show_see_more_button', 'admin_label' => true, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('See more button label', 'gon'), 'param_name' => 'see_more_button_text', 'admin_label' => true, 'value' => 'See more', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show in a carousel slider', 'gon'), 'param_name' => 'is_slider', 'admin_label' => true, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Rows', 'gon'), 'param_name' => 'rows', 'admin_label' => true, 'value' => array('1' => '1', '2' => '2'), 'description' => esc_html__('Number of Rows in slider', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''))));
    /*** TS Products In Sub Category Tabs ***/
    vc_map(array('name' => esc_html__('TS Products In Sub Category Tabs', 'gon'), 'base' => 'ts_products_in_sub_category_tabs', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'colorpicker', 'heading' => esc_html__('Color title', 'gon'), 'param_name' => 'color_title', 'admin_label' => true, 'value' => '#66b1d4', 'description' => ''), array('type' => 'iconpicker', 'heading' => esc_html__('Icon', 'gon'), 'param_name' => 'icon_fontawesome', 'admin_label' => true, 'value' => 'fa fa-info-circle', 'settings' => array('emptyIcon' => false, 'iconsPerPage' => 4000), 'description' => esc_html__('Add this icon before the block title', 'gon')), array('type' => 'attach_image', 'heading' => esc_html__('Custom Icon', 'gon'), 'param_name' => 'icon_image', 'admin_label' => false, 'value' => '', 'description' => ''), array('type' => 'colorpicker', 'heading' => esc_html__('Color icon', 'gon'), 'param_name' => 'color_icon', 'admin_label' => true, 'value' => '#73d2ff', 'description' => ''), array('type' => 'attach_images', 'heading' => esc_html__('Banners', 'gon'), 'param_name' => 'banners', 'admin_label' => false, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Banner position', 'gon'), 'param_name' => 'banner_position', 'admin_label' => true, 'value' => array('Bottom' => 'bottom', 'Top' => 'top'), 'description' => esc_html__('Display the banners on the top or bottom of products', 'gon')), array('type' => 'textarea', 'heading' => esc_html__('Links for banners', 'gon'), 'param_name' => 'links', 'admin_label' => false, 'value' => '', 'description' => esc_html__('A comma separated list of links. Ex: if you have 3 banners, the value of this field should be "link1, link2, link3"', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Product type', 'gon'), 'param_name' => 'product_type', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Category', 'gon'), 'param_name' => 'product_cat', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => false, 'sortable' => false, 'unique_values' => true), 'description' => esc_html__('You have to choose at least one category. Each tab will be a sub category of this category', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit sub categories', 'gon'), 'param_name' => 'limit_sub_cat', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Sub Categories. If this value is 0, the tab wont be displayed', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('The text of link to category page', 'gon'), 'param_name' => 'link_all_text', 'admin_label' => true, 'value' => 'All', 'description' => ''), array('type' => 'autocomplete', 'heading' => esc_html__('Featured product', 'gon'), 'param_name' => 'featured_product', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => false, 'sortable' => false, 'unique_values' => true), 'description' => esc_html__('This product will be displayed on the left side', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product SKU', 'gon'), 'param_name' => 'show_sku', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product short description', 'gon'), 'param_name' => 'show_short_desc', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product label', 'gon'), 'param_name' => 'show_label', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show add to cart button', 'gon'), 'param_name' => 'show_add_to_cart', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''))));
    /*** TS List Of Product Categories ***/
    vc_map(array('name' => esc_html__('TS List Of Product Categories', 'gon'), 'base' => 'ts_list_of_product_categories', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'attach_image', 'heading' => esc_html__('Background image', 'gon'), 'param_name' => 'bg_image', 'admin_label' => false, 'value' => '', 'description' => ''), array('type' => 'autocomplete', 'heading' => esc_html__('Product Category', 'gon'), 'param_name' => 'product_cat', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => false, 'sortable' => false, 'unique_values' => true), 'description' => esc_html__('Display sub categories of this category', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Include parent category in list', 'gon'), 'param_name' => 'include_parent', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Number of Sub Categories', 'gon'), 'param_name' => 'limit_sub_cat', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Leave blank to show all', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Include these categories', 'gon'), 'param_name' => 'include_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => esc_html__('If you set the Product Category option above, this option wont be available', 'gon')))));
}
/*** Add Shortcode Param ***/
WpbakeryShortcodeParams::addField('ts_category', 'ts_product_catgories_shortcode_param');
if (!function_exists('ts_product_catgories_shortcode_param')) {
    function ts_product_catgories_shortcode_param($settings, $value)
    {
        $categories = ts_get_list_categories_shortcode_param(0, $settings);
        $arr_value = explode(',', $value);
        ob_start();
        ?>
		<input type="hidden" class="wpb_vc_param_value wpb-textinput product_cats textfield ts-hidden-selected-categories" name="<?php 
        echo esc_attr($settings['param_name']);
        ?>
" value="<?php 
        echo esc_attr($value);
        ?>
" />
		<div class="categorydiv">