<?php
/**
 * Display Social Links
 *
 * @since Feminine Style 1.0.0
 *
 * @param null
 * @return void
 */
if ( ! function_exists( 'feminine_style_social_links' ) ) :

	function feminine_style_social_links() {

		$feminine_style_customizer_all_values = feminine_style_get_theme_options();
		$feminine_style_social_data           = json_decode( $feminine_style_customizer_all_values['feminine-style-social-data'] );
		if ( is_array( $feminine_style_social_data ) ) {
			echo '<ul class="socials at-display-inline-block">';
			foreach ( $feminine_style_social_data as $social_data ) {
				$icon     = $social_data->icon;
				$link     = $social_data->link;
				$checkbox = $social_data->checkbox;
				echo '<li>';
				echo '<a href="' . esc_url( $link ) . '" target="' . ( $checkbox == 1 ? '_blank' : '' ) . '">';
				echo '<i class="' . esc_attr( $icon ) . '"></i>';
				echo '</a>';
				echo '</li>';
			}
			echo '</ul>';
		}
	}
endif;
add_action( 'feminine_style_action_social_links', 'feminine_style_social_links', 10 );


if ( ! function_exists( 'feminine_style_action_top_menu' ) ) :

	function feminine_style_action_top_menu() {
		echo "<div class='at-first-level-nav at-display-inline-block text-right'>";
		wp_nav_menu(
			array(
				'theme_location' => 'top-menu',
				'container'      => false,
				'depth'          => 1,
			)
		);
		echo '</div>';
	}
endif;
add_action( 'feminine_style_action_top_menu', 'feminine_style_action_top_menu', 10 );
