File: //home/madepabj/hc-cosmetics.com/wp-content/plugins/dbea-shortcodes/shortcodes/sns_banner.php
<?php
// SNS Banner
if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
class WPBakeryShortCode_SNS_Banner extends WPBakeryShortCode {
function __construct( $settings ) {
parent::__construct( $settings );
}
}
}
add_shortcode('sns_banner', 'dbea_banner_template');
add_action('vc_after_init', 'dbea_banner_settings');
function dbea_banner_template($atts, $content = null) {
ob_start();
if ($template = dbea_shortcode_template('sns_banner'))
include $template;
return ob_get_clean();
}
function dbea_banner_settings() {
$extra_class = dbea_extra_class();
vc_map( array(
"name" => esc_html__("SNS Banner", 'dbea-shortcodes'),
"base" => "sns_banner",
"show_settings_on_create" => true ,
"is_container" => false ,
"icon" => "vc_icon_snstheme",
"class" => "vc_icon_snstheme",
"content_element" => true ,
"category" => esc_html__('DBea', 'dbea-shortcodes'),
'description' => esc_html__( 'Banner with image and heading, sub heading, ...', 'dbea-shortcodes' ),
"params" => array(
array(
"type" => "dropdown",
'value' => array(
esc_html__( 'Content text in left center', 'dbea-shortcodes' ) => '1',
esc_html__( 'Content text in left bottom', 'dbea-shortcodes' ) => '2',
// esc_html__( 'Product - Info text in bottom', 'dbea-shortcodes' ) => '3',
),
"heading" => esc_html__("Banner style", 'dbea-shortcodes'),
"param_name" => "style"
),
array(
"type" => "attach_image",
"heading" => esc_html__("Banner image", "dbea-shortcodes"),
"param_name" => "image"
),
array(
"type" => "textfield",
"heading" => esc_html__("Sub heading", 'dbea-shortcodes'),
"param_name" => "sub_heading" ,
"value" => esc_html__("Sub heading",'dbea-shortcodes'),
"dependency" => array(
'element' => 'style',
'value' => array('1')
),
),
array(
"type" => "textarea",
"heading" => esc_html__("Heading/Title", 'dbea-shortcodes'),
"param_name" => "heading" ,
"value" => esc_html__("Heading",'dbea-shortcodes'),
),
array(
'type' => 'vc_link',
'heading' => esc_html__( 'View link', 'dbea-shortcodes' ),
'param_name' => 'view_link',
"dependency" => array(
'element' => 'style',
'value' => array('1', '2')
),
),
array(
"type" => "textfield",
"heading" => esc_html__("Price", 'dbea-shortcodes'),
"param_name" => "price",
"value" => esc_html__("$15.00",'dbea-shortcodes'),
"dependency" => array(
'element' => 'style',
'value' => '3',
),
),
array(
"type" => "textfield",
"heading" => esc_html__("Wana show original price(discount)?", 'dbea-shortcodes'),
"param_name" => "o_price",
"value" => esc_html__("$17.00",'dbea-shortcodes'),
"dependency" => array(
'element' => 'style',
'value' => '3',
),
),
array(
'type' => 'vc_link',
'heading' => esc_html__( 'View button', 'dbea-shortcodes' ),
'param_name' => 'view_btn',
"dependency" => array(
'element' => 'style',
'value' => '3',
),
),
$extra_class,
vc_map_add_css_animation(),
)
));
}