<?php
/*
 * Templatation.com
 *
 * Banner with label slider for VC
 *
 */

function tt_lc_brands_fn_vc() {
    vc_map(
        array(
            "icon" => 'tt-vc-block',
            'name'                    => esc_html__( 'Clients Carousel' , 'logiscargo' ),
            'base'                    => 'tt_lc_brands_shortcode',
            'description'             => esc_html__( 'Auto Carousel of clients/brands image', 'logiscargo' ),
            'as_parent'               => array('only' => 'tt_lc_brands_item_shortcode'),
            'content_element'         => true,
            "js_view" => 'VcColumnView',
            "category" => esc_html__('Logiscargo', 'logiscargo'),
        )
    );
}
add_action( 'vc_before_init', 'tt_lc_brands_fn_vc' );
// Nested Element
function tt_lc_brands_item_fn_vc() {
    vc_map(
        array(
            "icon" => 'tt-vc-block',
            'name'            => esc_html__('Clients carousel item', 'logiscargo'),
            'base'            => 'tt_lc_brands_item_shortcode',
            "category" => esc_html__('Logiscargo', 'logiscargo'),
            'content_element' => true,
            'as_child'        => array('only' => 'tt_lc_brands_shortcode'), // Use only|except attributes to limit parent (separate multiple values with comma)
            'params'          => array(
                array(
                    'type' => 'attach_image',
                    'heading' => esc_html__( 'Brand image', 'logiscargo' ),
                    'param_name' => 'image',
                    'admin_label' => true,
                    'value' => '',
                    'description' => esc_html__( 'Select image from media library.', 'logiscargo' ),
                ),
            ),
        )
    );
}
add_action( 'vc_before_init', 'tt_lc_brands_item_fn_vc' );

// A must for container functionality, replace Wbc_Item with your base name from mapping for parent container
if(class_exists('WPBakeryShortCodesContainer')){
    class WPBakeryShortCode_tt_lc_brands_shortcode extends WPBakeryShortCodesContainer {

    }
}

// Replace Wbc_Inner_Item with your base name from mapping for nested element
if(class_exists('WPBakeryShortCode')){
    class WPBakeryShortCode_tt_lc_brands_item_shortcode extends WPBakeryShortCode {

    }
}