<?php
use MASCOTCOREEDUCACION\Lib;
use MASCOTCOREEDUCACION\CPT\VCSidebars\CPT_VC_Sidebars;
add_action( 'vc_before_init', 'mascot_core_educacion_reg_shortcodes_vcsidebars' );
function mascot_core_educacion_reg_shortcodes_vcsidebars() {
			$new_cpt_class = CPT_VC_Sidebars::Instance();
			$available_sidebars_array = get_posts( array( 'post_type' => $new_cpt_class->ptKey, 'posts_per_page' => - 1 ) );
			$available_sidebars = array( esc_html__( 'Select', 'mascot-core' ) => 0 );
			if ( $available_sidebars_array && ! is_wp_error( $available_sidebars_array ) ) {
				foreach ( $available_sidebars_array as $val ) {
					$available_sidebars[ get_the_title( $val ) ] = $val->ID;
				}
			}
	vc_map( array(
		'name'		=> esc_html__( 'VC Sidebars', 'mascot-core' ),
		'base'     => 'tmvc_vcsidebars',
		'category'	=> 'by TM',
		'icon'		=> 'mascot-vc-icons vc-icon-tm',
		'allowed_container_element' => 'vc_row',
		'params'	=>array(
			array(
				'type'			=> 'dropdown',
				"heading"		=> esc_html__( "Choose Sidebar", 'mascot-core' ),
				"param_name"	=> "sidebar",
				"value"			=> $available_sidebars,
				'admin_label'   => true,
				'save_always'   => true,
			),
			mascot_core_educacion_vc_add_css_editor(),
		)
	) );
	class WPBakeryShortCode_tmvc_vcsidebars extends WPBakeryShortCode {
	}
}