<?php
$css = '';
$args = array(
	'design_style' => 'style-default',
	'thumb_image_size' => '',
	
	'show_view_details_button' => 'true',
	'view_details_button_text' => esc_html__( 'View Details', 'educacion-wp' ),

	'show_title' => 'true',
	'show_excerpt' => 'true',
	'excerpt_length'	=> '',

	'selected_category' => '',
	'order_by' => 'name',
	'order' => 'ASC',

	'btn_design_style' => 'default',
	'button_size' => '',
	'btn_outlined' => false,
	'btn_round' => false,
	'btn_flat' => false,
	'btn_block' => false,
	'btn_threed_effect' => false,
	'button_alignment' => '',
	'button_hover_animation_effect' => '',
	
	'css' => ''
);
extract(shortcode_atts($args, $atts));
$params = shortcode_atts($args, $atts);
$classes[] = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ) );
?>
<?php
	$current_page_id = educacion_mascot_get_page_id();

	//Get all the taxonomies for this post type
	$params['holder_id'] = educacion_mascot_get_isotope_holder_ID('works');
	$classes[] = $params['design_style'];
	$params['classes'] = $classes;
	$params['columns'] = 3;
	//button classes
	$params['btn_classes'] = educacion_mascot_prepare_button_classes_from_params( $params );

	$selected_category = explode(',', $params['selected_category']);
	if( $selected_category[0] == '' ) { 
		$selected_category = array();
	}
	// Gets every "category" (term) in this taxonomy to get the respective posts

	//query args
	$args = array(
		'orderby' => $params['order_by'],
		'order' => $params['order'],
		'slug' => $selected_category,
	);
	$taxonomy = array( 
		'works_category',
	);
	$terms = get_terms($taxonomy, $args);
	$params['terms'] = $terms;
	$params['params'] = $params;
	$html = educacion_mascot_get_cpt_template_part( 'works-categories', null, 'works/shortcodes/tpl', $params, true );
	echo html_entity_decode($html);
?>