function widget($args, $instance)
    {
        extract($args);
        $instance = wp_parse_args((array) $instance, $this->get_default());
        $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
        echo htmlspecialchars_decode(esc_html($before_widget));
        if (!empty($title)) {
            echo htmlspecialchars_decode(esc_html($before_title . $title . $after_title));
        }
        $socials = origamiez_get_socials();
        if (!empty($socials)) {
            ?>
            <div class="social-link-inner clearfix">
                <?php 
            foreach ($socials as $social_slug => $social) {
                $url = get_theme_mod("{$social_slug}_url", '');
                $color = get_theme_mod("{$social_slug}_color", '');
                if ($url) {
                    $style = '';
                    if ($color) {
                        $style = sprintf('style="color:#FFF; background-color:%1$s; border-color: %1$s;"', $color);
                    }
                    if ('fa fa-rss' == $social['icon'] && empty($url)) {
                        $url = get_bloginfo('rss2_url');
                    }
                    ?>
                        <a href="<?php 
                    echo esc_url($url);
                    ?>
" 
                            data-placement="top"  
                            data-toggle="tooltip" 
                            title="<?php 
                    echo esc_attr($social['label']);
                    ?>
" 
                            rel="nofollow" 
                            target="_blank" 
                            class="origamiez-tooltip social-link social-link-first" <?php 
                    echo esc_attr($style);
                    ?>
>
                            <span class="<?php 
                    echo esc_attr($social['icon']);
                    ?>
"></span>
                        </a>
                        <?php 
                }
            }
            ?>
            </div>
            <?php 
        }
        echo htmlspecialchars_decode(esc_html($after_widget));
    }
function origamiez_get_custom_options()
{
    $custom_settings = array('panels' => array(array('id' => 'origamiez_general', 'title' => __('General Setting', 'origamiez')), array('id' => 'origamiez_typography', 'title' => __('Typography', 'origamiez')), array('id' => 'origamiez_social_links', 'title' => __('Social links', 'origamiez'))), 'sections' => array(array('id' => 'header_and_footer', 'panel' => 'origamiez_general', 'title' => __('Header & Footer', 'origamiez')), array('id' => 'layout', 'panel' => 'origamiez_general', 'title' => __('Layout', 'origamiez')), array('id' => 'blog_posts', 'panel' => 'origamiez_general', 'title' => __('Blog posts', 'origamiez')), array('id' => 'single_post', 'panel' => 'origamiez_general', 'title' => __('Single post', 'origamiez'))), 'settings' => array(array('id' => 'logo', 'label' => __('Logo', 'origamiez'), 'description' => __('Upload or enter your logo', 'origamiez'), 'default' => '', 'type' => 'upload', 'section' => 'header_and_footer', 'transport' => 'refresh'), array('id' => 'footer_information', 'label' => __('Footer information', 'origamiez'), 'description' => __('Enter your information, e.g. copyright, or Google AdSense code, ...', 'origamiez'), 'default' => __('Copyright &copy; Your Name', 'origamiez'), 'type' => 'textarea', 'section' => 'header_and_footer', 'transport' => 'refresh'), array('id' => 'use_layout_fullwidth', 'label' => __('Layout full width', 'origamiez'), 'description' => '', 'default' => 0, 'type' => 'checkbox', 'section' => 'layout', 'transport' => 'refresh'), array('id' => 'layout_taxonomy', 'label' => __('Thumbnail position', 'origamiez'), 'description' => '', 'default' => 'thumbnail-left', 'type' => 'radio', 'choices' => array('thumbnail-left' => __('Thumbnail left', 'origamiez'), 'thumbnail-right' => __('Thumbnail right', 'origamiez')), 'section' => 'blog_posts', 'transport' => 'refresh'), array('id' => 'is_show_taxonomy_datetime', 'label' => __('Show datetime', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'blog_posts', 'transport' => 'refresh'), array('id' => 'is_show_taxonomy_comments', 'label' => __('Show number of comments', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'blog_posts', 'transport' => 'refresh'), array('id' => 'is_show_post_datetime', 'label' => __('Show datetime', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'single_post', 'transport' => 'refresh'), array('id' => 'is_show_post_comments', 'label' => __('Show number of comments', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'single_post', 'transport' => 'refresh'), array('id' => 'is_show_post_category', 'label' => __('Show category', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'single_post', 'transport' => 'refresh'), array('id' => 'is_show_post_tag', 'label' => __('Show tag', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'single_post', 'transport' => 'refresh'), array('id' => 'is_show_post_adjacent', 'label' => __('Show next & prev posts', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'single_post', 'transport' => 'refresh'), array('id' => 'is_show_post_author_info', 'label' => __('Show author information', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'single_post', 'transport' => 'refresh'), array('id' => 'is_show_post_related', 'label' => __('Show related posts', 'origamiez'), 'description' => '', 'default' => 1, 'type' => 'checkbox', 'section' => 'single_post', 'transport' => 'refresh'), array('id' => 'skin', 'label' => __('Color Scheme', 'origamiez'), 'description' => '', 'default' => 'default', 'type' => 'radio', 'section' => 'colors', 'transport' => 'refresh', 'choices' => array('default' => __('Default', 'origamiez'), 'custom' => __('Custom', 'origamiez'))), array('id' => 'primary_color', 'type' => 'color', 'label' => __('Primary color', 'origamiez'), 'description' => '', 'default' => '#E74C3C', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'secondary_color', 'type' => 'color', 'label' => __('Secondary color', 'origamiez'), 'description' => '', 'default' => '#F9F9F9', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'body_color', 'type' => 'color', 'label' => __('Body text color', 'origamiez'), 'description' => '', 'default' => '#555555', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'heading_color', 'type' => 'color', 'label' => __('Heading color', 'origamiez'), 'description' => '', 'default' => '#444444', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'link_color', 'type' => 'color', 'label' => __('Link color', 'origamiez'), 'description' => '', 'default' => '#444444', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'main_menu_color', 'type' => 'color', 'label' => __('Main menu text color', 'origamiez'), 'description' => '', 'default' => '#666666', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'line_1_color', 'type' => 'color', 'label' => __('Line 1 color', 'origamiez'), 'description' => '', 'default' => '#555555', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'line_2_color', 'type' => 'color', 'label' => __('Line 2 color', 'origamiez'), 'description' => '', 'default' => '#D8D8D8', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'line_3_color', 'type' => 'color', 'label' => __('Line 3 color', 'origamiez'), 'description' => '', 'default' => '#E5E5E5', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'footer_sidebars_bg_color', 'type' => 'color', 'label' => __('Footer sidebar background color', 'origamiez'), 'description' => '', 'default' => '#222222', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'footer_sidebars_text_color', 'type' => 'color', 'label' => __('Footer sidebar text color', 'origamiez'), 'description' => '', 'default' => '#999999', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'footer_widget_title_color', 'type' => 'color', 'label' => __('Footer widget title color', 'origamiez'), 'description' => '', 'default' => '#FFFFFF', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'footer_info_bg_color', 'type' => 'color', 'label' => __('Footer info background color', 'origamiez'), 'description' => '', 'default' => '#111111', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh'), array('id' => 'footer_info_text_color', 'type' => 'color', 'label' => __('Footer info text color', 'origamiez'), 'description' => '', 'default' => '#999999', 'section' => 'colors', 'active_callback' => 'origamiez_skin_custom_callback', 'transport' => 'refresh')));
    $social_objects = origamiez_get_socials();
    foreach ($social_objects as $social_slug => $social) {
        $custom_settings['sections'][] = array('id' => "social_{$social_slug}", 'panel' => 'origamiez_social_links', 'title' => $social['label']);
        $custom_settings['settings'][] = array('id' => "{$social_slug}_url", 'label' => __('URL', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'text', 'section' => "social_{$social_slug}", 'transport' => 'refresh');
        $custom_settings['settings'][] = array('id' => "{$social_slug}_color", 'label' => __('Color', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'color', 'section' => "social_{$social_slug}", 'transport' => 'refresh');
    }
    $font_objects = array('font_body' => __('Body', 'origamiez'), 'font_menu' => __('Menu', 'origamiez'), 'font_widget_title' => __('Widget title', 'origamiez'), 'font_h1' => __('Heading 1', 'origamiez'), 'font_h2' => __('Heading 2', 'origamiez'), 'font_h3' => __('Heading 3', 'origamiez'), 'font_h4' => __('Heading 4', 'origamiez'), 'font_h5' => __('Heading 5', 'origamiez'), 'font_h6' => __('Heading 6', 'origamiez'));
    foreach ($font_objects as $font_slug => $font_title) {
        $custom_settings['sections'][] = array('id' => "custom_{$font_slug}", 'panel' => 'origamiez_typography', 'title' => $font_title);
        $custom_settings['settings'][] = array('id' => "{$font_slug}_is_enable", 'label' => __('Check to enable', 'origamiez'), 'description' => '', 'default' => 0, 'type' => 'checkbox', 'section' => "custom_{$font_slug}", 'transport' => 'refresh');
        $custom_settings['settings'][] = array('id' => "{$font_slug}_family", 'label' => __('Font Family', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'select', 'choices' => origamiez_get_font_families(), 'section' => "custom_{$font_slug}", 'transport' => 'refresh', 'active_callback' => "origamiez_{$font_slug}_enable_callback");
        $custom_settings['settings'][] = array('id' => "{$font_slug}_size", 'label' => __('Font Size', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'select', 'choices' => origamiez_get_font_sizes(), 'section' => "custom_{$font_slug}", 'transport' => 'refresh', 'active_callback' => "origamiez_{$font_slug}_enable_callback");
        $custom_settings['settings'][] = array('id' => "{$font_slug}_style", 'label' => __('Font Style', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'select', 'choices' => origamiez_get_font_styles(), 'section' => "custom_{$font_slug}", 'transport' => 'refresh', 'active_callback' => "origamiez_{$font_slug}_enable_callback");
        $custom_settings['settings'][] = array('id' => "{$font_slug}_weight", 'label' => __('Font Weight', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'select', 'choices' => origamiez_get_font_weights(), 'section' => "custom_{$font_slug}", 'transport' => 'refresh', 'active_callback' => "origamiez_{$font_slug}_enable_callback");
        $custom_settings['settings'][] = array('id' => "{$font_slug}_line_height", 'label' => __('Line height', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'select', 'choices' => origamiez_get_font_line_heighs(), 'section' => "custom_{$font_slug}", 'transport' => 'refresh', 'active_callback' => "origamiez_{$font_slug}_enable_callback");
        /*
         * ----------------------------------------
         * Banner
         * ---------------------------------------- 
         */
        $custom_settings['settings'][] = array('id' => "top_banner_url", 'label' => __('Link to', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'text', 'section' => 'header_image', 'transport' => 'refresh');
        $custom_settings['settings'][] = array('id' => "top_banner_title", 'label' => __('Title of banner', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'text', 'section' => 'header_image', 'transport' => 'refresh');
        $custom_settings['settings'][] = array('id' => "top_banner_custom", 'label' => __('Custom HTML', 'origamiez'), 'description' => '', 'default' => '', 'type' => 'textarea', 'section' => 'header_image', 'transport' => 'refresh');
    }
    return $custom_settings;
}