<?php

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

function shrk_sc_simpleheading( $atts ) {
	
	extract( shortcode_atts( array(
		'heading_text'  => 'your Heading text',
		'heading_style' => 'widget-title',
		'heading_type'  => 'h3',
	), $atts ) );

	return '<div class="' . esc_attr( $heading_style ) . '-wrapper"><' . esc_attr( $heading_type ) . ' class="' . esc_attr( $heading_style ) . '">' . esc_html( $heading_text ) . '</' . esc_attr( $heading_type ) . '></div>';
} 

add_action( 'init', function () {
	add_shortcode('shrk_simpleheading', 'shrk_sc_simpleheading');
});

add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes, $d ) {

	$shrk_vc_shortcodes['shrk_simpleheading'] =  array(
		'name'                    => esc_html__('Simple heading', 'dvl-uxshop-shortcodes'), /* */
		'category'                => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'),
		'base'                    => 'shrk_simpleheading',
		'icon'                    => 'icon-wpb-shrk',
		'show_settings_on_create' => true,
		'params'                  => array(
			array(
				'type'       => 'textarea',
				'heading'    => esc_html__('Heading text', 'dvl-uxshop-shortcodes'),
				'param_name' => 'heading_text',
				'value'      => esc_html__( 'your Heading text', 'dvl-uxshop-shortcodes' )
				),
			array(
				'type'       => 'dropdown',
				'heading'    => esc_html__('Heading style', 'dvl-uxshop-shortcodes'),
				'param_name' => 'heading_style',
				'value'      => array(
					esc_html__( 'Widget title', 'dvl-uxshop-shortcodes') => 'widget-title',
					esc_html__( 'Section title', 'dvl-uxshop-shortcodes') => 'section-title',
					)
				),
			array(
				'type'       => 'dropdown',
				'heading'    => esc_html__('Heading type', 'dvl-uxshop-shortcodes'),
				'param_name' => 'heading_type',
				'value'      => array(
					'H1' => 'h1',
					'H2' => 'h2',
					'H3' => 'h3',
					'H4' => 'h4',
					'H5' => 'h5',
					'H6' => 'h6'
					),
				'std'        => 'h3'
				),
			)
		);

	return $shrk_vc_shortcodes;
},10 ,2 );

?>