<?php
    /*
     * Method process option
     * # option 1: config font
     * # option 2: process config theme
    */
    if( !is_admin() ):

        add_action('wp_head','milktea_config_theme');

        function milktea_config_theme() {

            global $milktea_options;
            $milktea_favicon = $milktea_options['milktea_favicon_upload']['url'];


            if( $milktea_favicon != '' ) :

                echo '<link rel="shortcut icon" href="' . esc_url( $milktea_favicon ) . '" type="image/x-icon" />';

            endif;

        }

        // Method add custom css, Css custom add here
        // Inline css add here
        /**
         * Enqueues front-end CSS for the custom css.
         *
         * @see wp_add_inline_style()
         */

        add_action( 'wp_enqueue_scripts', 'milktea_custom_css', 99 );

        function milktea_custom_css() {

            global $milktea_options;

            $milktea_typo_selecter_1   =   $milktea_options['milktea_custom_typography_1_selector'];

            $milktea_typo1_font_family   =   $milktea_options['milktea_custom_typography_1']['font-family'] == '' ? '' : $milktea_options['milktea_custom_typography_1']['font-family'];

            $milktea_css_style = '';

            if ( $milktea_typo1_font_family != '' ) :
                $milktea_css_style .= ' '.esc_attr( $milktea_typo_selecter_1 ).' { font-family: '.balanceTags( $milktea_typo1_font_family, true ).' }';
            endif;

            if ( $milktea_css_style != '' ) :
                wp_add_inline_style( 'style', $milktea_css_style );
            endif;

        }

    endif

?>