<?php
	$members = '';

	foreach($instance['team_member'] as $item) {
		$social = '';
		
		foreach($item['social'] as $social_item) {
			$social .= '[team_member_social icon="' . $social_item['icon'] . '" url="' . $social_item['url'] . '"]';
		}

		$image = $item['image_fallback'];

		if( $item['image'] ) {
			$image = wp_get_attachment_image_src($item['image'], 'full');
			$image = $image[0];
		}

		$members .= '[team_member title="' . $item['title'] . '" name="' . $item['name'] . '" image="' . $image . '"]' . $social . '[/team_member]';
	}
	
	echo do_shortcode('[team]' . $members . '[/team]');
?>