';
$output .= do_shortcode($content);
$output .= '';
ob_start();
?>
';
$output .= do_shortcode(wp_kses_post($content));
$output .= '';
return apply_filters('lvca_carousel_item_output', $output, $content, $settings);
}
function map_vc_element() {
if (function_exists("vc_map")) {
$carousel_params = lvca_get_vc_map_carousel_options();
$carousel_params = array_merge($carousel_params, lvca_get_vc_map_carousel_display_options());
$customizer_params = array(
array(
'type' => 'lvca_infobox',
'text' => __('Easily customize this widget with the intuitive yet powerful visual styles editor - ', 'livemesh-vc-addons') . '' . __('SiteOrigin CSS.', 'livemesh-vc-addons') . '',
'param_name' => 'customize_widget',
'edit_field_class' => 'lvca-infobox-wrap vc_column vc_col-sm-12',
'group' => __('Customize', 'livemesh-vc-addons'),
),
);
$carousel_params = array_merge($carousel_params, $customizer_params);
//Register "container" content element. It will hold all your inner (child) content elements
vc_map(array(
"name" => __("Carousel", "livemesh-vc-addons"),
"base" => "lvca_carousel",
"as_parent" => array('only' => 'lvca_carousel_item'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma)
"content_element" => true,
"show_settings_on_create" => true,
"category" => __("Livemesh Addons", "livemesh-vc-addons"),
"is_container" => true,
'description' => __('Display a carousel of html elements.', 'livemesh-vc-addons'),
"js_view" => 'VcColumnView',
"icon" => 'icon-lvca-carousel',
"params" => $carousel_params
));
}
}
function map_child_vc_element() {
if (function_exists("vc_map")) {
vc_map(array(
"name" => __("Carousel", "livemesh-vc-addons"),
"base" => "lvca_carousel_item",
"content_element" => true,
"as_child" => array('only' => 'lvca_carousel'), // Use only|except attributes to limit parent (separate multiple values with comma)
"icon" => 'icon-lvca-carousel-item',
"category" => __("Livemesh Addons", "livemesh-vc-addons"),
"params" => array(
array(
'type' => 'textfield',
'param_name' => 'name',
'admin_label' => true,
'heading' => __('Name', 'livemesh-vc-addons'),
'description' => __('The title to identify the HTML element. Will not be output to the frontend.', 'livemesh-vc-addons'),
),
array(
'type' => 'textarea_html',
'param_name' => 'content',
'heading' => __('HTML element', 'livemesh-vc-addons'),
'description' => __('The HTML content for the carousel item. Custom CSS for presentation of the HTML elements should be entered by the user in Settings->Custom CSS panel in WPBakery Page Builder or in the theme files.', 'livemesh-vc-addons'),
),
)
)
);
}
}
}
//Your "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
if (class_exists('WPBakeryShortCodesContainer')) {
class WPBakeryShortCode_lvca_carousel extends WPBakeryShortCodesContainer {
}
}
if (class_exists('WPBakeryShortCode')) {
class WPBakeryShortCode_lvca_carousel_item extends WPBakeryShortCode {
}
}
// Initialize Element Class
if (class_exists('LVCA_Carousel')) {
new LVCA_Carousel();
}