<?php
$css = '';
extract(shortcode_atts(array(
    'css' => ''
), $atts));
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ) );
?>
<?php
	$current_page_id = educacion_mascot_get_page_id();
?>

<?php
use MASCOTCOREEDUCACION\CPT\Resources\CPT_Resources;
if( class_exists('MASCOTCOREEDUCACION\CPT\Resources\CPT_Resources') ) {
  $resources_cpt_class = CPT_Resources::Instance();
  $social_links = $resources_cpt_class->socialList();

  $link_array = array();
  if( $social_links ): foreach( $social_links as $key => $value ) {
	$current_link = educacion_mascot_get_rwmb_group( 'educacion_mascot_' . "resources_mb_social_info", "resources_social_".$key );
	
	if( isset( $current_link ) && $current_link != '' ) :
		$link_array[$key] = $current_link;
	endif;
  } endif;

  if( !empty( $link_array ) ) :
?>
<div class="widget widget-resources resources-social-info <?php echo esc_attr( $css_class ); ?>">
<ul class="<?php echo esc_attr( apply_filters( 'educacion_mascot_tmvc_resources_social_info', 'styled-icons icon-dark icon-theme-colored1 icon-circled icon-sm icon-theme-colored pl-0') ); ?>">
	<?php 
	foreach( $link_array as $key => $url ) {
	?>
	<li><a href="<?php echo esc_url( $url ); ?>" target="_blank"><i class="fa fa-<?php echo esc_attr( $key ); ?>"></i></a></li>
	<?php } ?>
</ul>
</div>
<?php
  endif;
}
?>