<?php

/* Theme setup section
-------------------------------------------------------------------- */
if (!function_exists('seohub_sc_gap_theme_setup')) {
	add_action( 'seohub_action_before_init_theme', 'seohub_sc_gap_theme_setup' );
	function seohub_sc_gap_theme_setup() {
		add_action('seohub_action_shortcodes_list', 		'seohub_sc_gap_reg_shortcodes');
		if (function_exists('seohub_exists_visual_composer') && seohub_exists_visual_composer())
			add_action('seohub_action_shortcodes_list_vc','seohub_sc_gap_reg_shortcodes_vc');
	}
}



/* Shortcode implementation
-------------------------------------------------------------------- */

//[trx_gap]Fullwidth content[/trx_gap]

if (!function_exists('seohub_sc_gap')) {	
	function seohub_sc_gap($atts, $content = null) {
		if (seohub_in_shortcode_blogger()) return '';
		$output = seohub_gap_start() . do_shortcode($content) . seohub_gap_end();
		return apply_filters('seohub_shortcode_output', $output, 'trx_gap', $atts, $content);
	}
	seohub_require_shortcode("trx_gap", "seohub_sc_gap");
}



/* Add shortcode in the internal SC Builder
-------------------------------------------------------------------- */
if ( !function_exists( 'seohub_sc_gap_reg_shortcodes' ) ) {
	//add_action('seohub_action_shortcodes_list', 'seohub_sc_gap_reg_shortcodes');
	function seohub_sc_gap_reg_shortcodes() {
		global $SEOHUB_GLOBALS;
	
		$SEOHUB_GLOBALS['shortcodes']["trx_gap"] = array(
			"title" => esc_html__("Gap", "seohub"),
			"desc" => wp_kses( __("Insert gap (fullwidth area) in the post content. Attention! Use the gap only in the posts (pages) without left or right sidebar", "seohub"), $SEOHUB_GLOBALS['allowed_tags'] ),
			"decorate" => true,
			"container" => true,
			"params" => array(
				"_content_" => array(
					"title" => esc_html__("Gap content", "seohub"),
					"desc" => wp_kses( __("Gap inner content", "seohub"), $SEOHUB_GLOBALS['allowed_tags'] ),
					"rows" => 4,
					"value" => "",
					"type" => "textarea"
				)
			)
		);
	}
}


/* Add shortcode in the VC Builder
-------------------------------------------------------------------- */
if ( !function_exists( 'seohub_sc_gap_reg_shortcodes_vc' ) ) {
	//add_action('seohub_action_shortcodes_list_vc', 'seohub_sc_gap_reg_shortcodes_vc');
	function seohub_sc_gap_reg_shortcodes_vc() {
		global $SEOHUB_GLOBALS;
	
		vc_map( array(
			"base" => "trx_gap",
			"name" => esc_html__("Gap", "seohub"),
			"description" => wp_kses( __("Insert gap (fullwidth area) in the post content", "seohub"), $SEOHUB_GLOBALS['allowed_tags'] ),
			"category" => esc_html__('Structure', 'js_composer'),
			'icon' => 'icon_trx_gap',
			"class" => "trx_sc_collection trx_sc_gap",
			"content_element" => true,
			"is_container" => true,
			"show_settings_on_create" => false,
			"params" => array(
				/*
				array(
					"param_name" => "content",
					"heading" => esc_html__("Gap content", "seohub"),
					"description" => wp_kses( __("Gap inner content", "seohub"), $SEOHUB_GLOBALS['allowed_tags'] ),
					"class" => "",
					"value" => "",
					"type" => "textarea_html"
				)
				*/
			)
		) );
		
		class WPBakeryShortCode_Trx_Gap extends SEOHUB_VC_ShortCodeCollection {}
	}
}
?>