'',
'subtitle' => false,
'short_text' => false,
'style' => 'style1',
'align' => 'center',
'animation' => 'none'
), $atts);
// Sanitize settings
$settings['heading'] = sanitize_text_field($settings['heading']);
$settings['subtitle'] = sanitize_text_field($settings['subtitle']);
$settings['short_text'] = sanitize_text_field($settings['short_text']);
$settings['style'] = sanitize_text_field($settings['style']);
$settings['align'] = sanitize_text_field($settings['align']);
$settings['animation'] = sanitize_text_field($settings['animation']);
list($animate_class, $animation_attr) = lvca_get_animation_atts($settings['animation']);
$output = '
';
if ($settings['style'] == 'style2' && !empty($settings['subtitle'])):
$output .= '
' . esc_html($settings['subtitle']) . '
';
endif;
$output .= '
' . wp_kses_post($settings['heading']) . '
';
if ($settings['style'] != 'style3' && !empty($settings['short_text'])):
$output .= '
' . wp_kses_post($settings['short_text']) . '
';
endif;
$output .= '
';
return apply_filters('lvca_heading_output', $output, $content, $settings);
}
function map_vc_element() {
if (function_exists("vc_map")) {
//Register "container" content element. It will hold all your inner (child) content elements
vc_map(array(
"name" => __("Heading", "livemesh-vc-addons"),
"base" => "lvca_heading",
"content_element" => true,
"show_settings_on_create" => true,
"category" => __("Livemesh Addons", "livemesh-vc-addons"),
'description' => __('Create heading for a section.', 'livemesh-vc-addons'),
"icon" => 'icon-lvca-heading',
"params" => array(
// add params same as with any other content element
array(
'type' => 'textfield',
'param_name' => 'heading',
"admin_label" => true,
'heading' => __('Title', 'livemesh-vc-addons'),
'description' => __('Title for the heading.', 'livemesh-vc-addons'),
),
array(
'type' => 'textfield',
'param_name' => 'subtitle',
'heading' => __('Subheading or Subtitle', 'livemesh-vc-addons'),
'description' => __('A subtitle displayed above the title heading.', 'livemesh-vc-addons'),
'dependency' => array(
'element' => 'style',
'value' => 'style2',
),
),
array(
'type' => 'textarea',
'param_name' => 'short_text',
'heading' => __('Short Text', 'livemesh-vc-addons'),
'description' => __('Short text generally displayed below the heading title.', 'livemesh-vc-addons'),
'dependency' => array(
'element' => 'style',
'value' => array('style1', 'style2'),
),
),
array(
"type" => "dropdown",
"param_name" => "style",
"heading" => __("Choose Style", "livemesh-vc-addons"),
"description" => __("Choose the particular style of heading you need", "livemesh-vc-addons"),
'value' => array(
__('Style 1', 'livemesh-vc-addons') => 'style1',
__('Style 2', 'livemesh-vc-addons') => 'style2',
__('Style 3', 'livemesh-vc-addons') => 'style3',
),
'std' => 'style1',
'group' => __('Settings', 'livemesh-vc-addons')
),
array(
"type" => "dropdown",
"param_name" => "align",
"heading" => __("Align", "livemesh-vc-addons"),
"description" => __("Alignment of the heading", "livemesh-vc-addons"),
'value' => array(
__('Center', 'livemesh-vc-addons') => 'center',
__('Left', 'livemesh-vc-addons') => 'left',
__('Right', 'livemesh-vc-addons') => 'right',
),
'std' => 'center',
'group' => __('Settings', 'livemesh-vc-addons')
),
array(
"type" => "dropdown",
"param_name" => "animation",
"heading" => __("Choose Animation Type", "livemesh-vc-addons"),
'value' => lvca_get_animation_options(),
'std' => 'none',
'group' => __('Settings', 'livemesh-vc-addons')
),
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'),
),
),
));
}
}
}
if (class_exists('WPBakeryShortCode')) {
class WPBakeryShortCode_lvca_heading extends WPBakeryShortCode {
}
}
// Initialize Element Class
if (class_exists('LVCA_Heading')) {
new LVCA_Heading();
}