<?php

// Construction our clients shortcode
function construction_project_detail_shortcode( $atts, $content = null ){	
	// Extract our clients value
	extract( shortcode_atts( array(
		'project_details' => '',		
	), $atts ) );

	ob_start();

	$project_details = (array) vc_param_group_parse_atts( $project_details );
	
	if( !empty( $project_details ) ){
	    foreach ( $project_details as $data ) :
			echo '<div class="info-field">';
			echo '<span class="info-icon">'.sprintf( esc_html__( '%s', 'construction' ), $data['project_detail_icon'] ).'</span>';
			echo '<span class="info-title">'.sprintf( esc_html__( '%s', 'construction' ), $data['project_detail_label'] ).'</span>';
			echo '<p class="info-content">'.sprintf( esc_html__( '%s', 'construction' ), $data['project_detail_value'] ).'</p>';
			echo '</div>';
		endforeach;
	}

	$output = ob_get_contents();
        
    ob_end_clean();

    return $output;
}
add_shortcode( 'project_detail', 'construction_project_detail_shortcode' );

?>