<?php

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

function shrk_sc_quote( $atts ) {
	
	extract( shortcode_atts( array(
		'quotetext'   => '',
		'quoteauthor' => '',
		'alignment'   => 'default',
	), $atts ) );

	$class = '';
	if ( $alignment != 'default' ) { $class = $alignment; }

	return '
			<div class="quote-wrapper ' . esc_attr( $class ) . '">
				<div class="quote"><i class="fa fa-quote-left"></i>' . $quotetext . '<i class="fa fa-quote-right"></i></div>
				<div class="author">' . $quoteauthor . '</div>
			</div>
	';
} 

add_action( 'init', function () {
	add_shortcode('shrk_quote', 'shrk_sc_quote');
});

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

	$shrk_vc_shortcodes["shrk_quote"] =  array(
		"name" => esc_html__("Quote", 'dvl-uxshop-shortcodes'), /* */
		"base" => "shrk_quote",
		"category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'),
		"icon" => "icon-wpb-shrk",
		"show_settings_on_create" => true,
		"params" => array(
			array(
				"type" => "textarea",
				"class" => "",
				"heading" => esc_html__("Quote text", 'dvl-uxshop-shortcodes'),
				"param_name" => "quotetext",
						),
			array(
				"type" => "textfield",
				"class" => "",
				"heading" => esc_html__("Quote author", 'dvl-uxshop-shortcodes'),
				"param_name" => "quoteauthor",
				"value" => '',
				),
			array(
				"type" => "dropdown",
				"class" => "",
				"heading" => esc_html__("Text Alignment", 'dvl-uxshop-shortcodes'),
				"param_name" => "alignment",
				"value" => $d['alignment_text_options']
				),
			)
		);

	return $shrk_vc_shortcodes;
},10 ,2 );

?>