manager->get_control( $setting->id )->choices; // return default if not valid return ( array_key_exists( $input, $options ) ? $input : $setting->default ); } // number absint function amazin_sanitize_number_absint( $number, $setting ) { // ensure $number is an absolute integer $number = absint( $number ); // return default if not integer return ( $number ? $number : $setting->default ); } // textarea function amazin_sanitize_textarea( $input ) { $allowedtags = array( 'a' => array( 'href' => array(), 'title' => array(), '_blank' => array() ), 'img' => array( 'src' => array(), 'alt' => array(), 'width' => array(), 'height' => array(), 'style' => array(), 'class' => array(), 'id' => array() ), 'br' => array(), 'em' => array(), 'strong' => array() ); // return filtered html return wp_kses( $input, $allowedtags ); } // Custom Controls function amazin_sanitize_custom_control( $input ) { return $input; } /* ** Reusable Functions ===== */ // checkbox function amazin_checkbox_control( $section, $id, $name, $transport, $priority ) { global $wp_customize; $section_id = 'amazin_'. $section; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'amazin_sanitize_checkbox' ) ); $wp_customize->add_control( 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => $section_id, 'type' => 'checkbox', 'priority' => $priority ) ); } // text function amazin_text_control( $section, $id, $name, $transport, $priority ) { global $wp_customize; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => 'amazin_'. $section, 'type' => 'text', 'priority' => $priority ) ); } // color function amazin_color_control( $section, $id, $name, $transport, $priority ) { global $wp_customize; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => 'amazin_'. $section, 'priority' => $priority ) ) ); } // textarea function amazin_textarea_control( $section, $id, $name, $description, $transport, $priority ) { global $wp_customize; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'amazin_sanitize_textarea' ) ); $wp_customize->add_control( 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'description' => wp_kses_post($description), 'section' => 'amazin_'. $section, 'type' => 'textarea', 'priority' => $priority ) ); } // url function amazin_url_control( $section, $id, $name, $transport, $priority ) { global $wp_customize; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => 'amazin_'. $section, 'type' => 'text', 'priority' => $priority ) ); } // number absint function amazin_number_absint_control( $section, $id, $name, $atts, $transport, $priority ) { global $wp_customize; if ( $section !== 'title_tagline' ) { $section_id = 'amazin_'. $section; } else { $section_id = $section; } $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'amazin_sanitize_number_absint' ) ); $wp_customize->add_control( 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => $section_id, 'type' => 'number', 'input_attrs' => $atts, 'priority' => $priority ) ); } // select function amazin_select_control( $section, $id, $name, $atts, $transport, $priority ) { global $wp_customize; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'amazin_sanitize_select' ) ); $wp_customize->add_control( 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => 'amazin_'. $section, 'type' => 'select', 'choices' => $atts, 'priority' => $priority ) ); } // radio function amazin_radio_control( $section, $id, $name, $atts, $transport, $priority ) { global $wp_customize; $section_id = 'amazin_'. $section; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'amazin_sanitize_select' ) ); $wp_customize->add_control( 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => $section_id, 'type' => 'radio', 'choices' => $atts, 'priority' => $priority ) ); } // image function amazin_image_control( $section, $id, $name, $transport, $priority ) { global $wp_customize; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => amazin_options( $section .'_'. $id), 'type' => 'option', 'transport' => $transport, 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => 'amazin_'. $section, 'priority' => $priority ) ) ); } // image crop function amazin_image_crop_control( $section, $id, $name, $width, $height, $transport, $priority ) { global $wp_customize; $wp_customize->add_setting( 'amazin_options['. $section .'_'. $id .']', array( 'default' => '', 'type' => 'option', 'transport' => $transport, 'sanitize_callback' => 'amazin_sanitize_number_absint' ) ); $wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'amazin_options['. $section .'_'. $id .']', array( 'label' => $name, 'section' => 'amazin_'. $section, 'flex_width' => false, 'flex_height' => false, 'width' => $width, 'height' => $height, 'priority' => $priority ) ) ); } // Pro Version class Amazin_Customize_Pro_Version extends WP_Customize_Control { public $type = 'pro_options'; public function render_content() { echo 'Want more '. esc_html( $this->label ) .'?'; echo ''; echo ''; echo ' '. esc_html__( 'See Amazin PRO', 'amazin' ) .''; echo ''; } } // Pro Version Links class Amazin_Customize_Pro_Version_Links extends WP_Customize_Control { public $type = 'pro_links'; public function render_content() { ?> add_section( 'amazin_pro' , array( 'title' => esc_html__( 'About Amazin', 'amazin' ), 'priority' => 1, 'capability' => 'edit_theme_options' ) ); // Pro Version $wp_customize->add_setting( 'pro_version_', array( 'sanitize_callback' => 'amazin_sanitize_custom_control' ) ); $wp_customize->add_control( new Amazin_Customize_Pro_Version_Links ( $wp_customize, 'pro_version_', array( 'section' => 'amazin_pro', 'type' => 'pro_links', 'label' => '', 'priority' => 1 ) ) ); /* ** Colors ===== */ // add Colors section $wp_customize->add_section( 'amazin_colors' , array( 'title' => esc_html__( 'Colors', 'amazin' ), 'priority' => 1, 'capability' => 'edit_theme_options' ) ); // Content Accent amazin_color_control( 'colors', 'content_accent', esc_html__( 'Accent', 'amazin' ), 'postMessage', 3 ); $wp_customize->get_control( 'header_textcolor' )->section = 'amazin_colors'; $wp_customize->get_control( 'header_textcolor' )->priority = 6; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; // Header Background amazin_color_control( 'colors', 'header_text_bg', esc_html__( 'Header Text Background Color', 'amazin' ), 'postMessage', 9 ); amazin_color_control( 'colors', 'header_bg', esc_html__( 'Header Background Color', 'amazin' ), 'postMessage', 9 ); // Body Background $wp_customize->get_control( 'background_color' )->section = 'amazin_colors'; $wp_customize->get_control( 'background_color' )->priority = 12; $wp_customize->get_control( 'background_color' )->label = 'Body Background Color'; $wp_customize->get_control( 'background_image' )->section = 'amazin_colors'; $wp_customize->get_control( 'background_image' )->priority = 15; $wp_customize->get_control( 'background_preset' )->section = 'amazin_colors'; $wp_customize->get_control( 'background_preset' )->priority = 18; $wp_customize->get_control( 'background_position' )->section = 'amazin_colors'; $wp_customize->get_control( 'background_position' )->priority = 21; $wp_customize->get_control( 'background_size' )->section = 'amazin_colors'; $wp_customize->get_control( 'background_size' )->priority = 23; $wp_customize->get_control( 'background_repeat' )->section = 'amazin_colors'; $wp_customize->get_control( 'background_repeat' )->priority = 25; $wp_customize->get_control( 'background_attachment' )->section = 'amazin_colors'; $wp_customize->get_control( 'background_attachment' )->priority = 27; // Pro Version $wp_customize->add_setting( 'pro_version_colors', array( 'sanitize_callback' => 'amazin_sanitize_custom_control' ) ); $wp_customize->add_control( new Amazin_Customize_Pro_Version ( $wp_customize, 'pro_version_colors', array( 'section' => 'amazin_colors', 'type' => 'pro_options', 'label' => esc_html__( 'Colors', 'amazin' ), 'description' => esc_html( 'optimathemes.com/themes/amazin-pro?ref=amazin-free-colors-customizer' ), 'priority' => 100 ) ) ); /* ** General Layouts ===== */ // add General Layouts section $wp_customize->add_section( 'amazin_general' , array( 'title' => esc_html__( 'General Layouts', 'amazin' ), 'priority' => 3, 'capability' => 'edit_theme_options' ) ); // Sidebar Width amazin_number_absint_control( 'general', 'sidebar_width', esc_html__( 'Sidebar Width', 'amazin' ), array( 'step' => '1' ), 'refresh', 3 ); // Sticky Sidebar amazin_checkbox_control( 'general', 'sidebar_sticky', esc_html__( 'Enable Sticky Sidebar', 'amazin' ), 'refresh', 5 ); $boxed_width = array( 'full' => esc_html__( 'Full', 'amazin' ), 'contained' => esc_html__( 'Contained', 'amazin' ), 'boxed' => esc_html__( 'Boxed', 'amazin' ), ); // Header Width amazin_select_control( 'general', 'header_width', esc_html__( 'Header Width', 'amazin' ), $boxed_width, 'refresh', 25 ); $boxed_width_slider = array( 'full' => esc_html__( 'Full', 'amazin' ), 'boxed' => esc_html__( 'Boxed', 'amazin' ), ); // Slider Width amazin_select_control( 'general', 'slider_width', esc_html__( 'Featured Slider Width', 'amazin' ), $boxed_width_slider, 'refresh', 27 ); // Featured Links Width amazin_select_control( 'general', 'links_width', esc_html__( 'Featured Links Width', 'amazin' ), $boxed_width_slider, 'refresh', 28 ); // Content Width amazin_select_control( 'general', 'content_width', esc_html__( 'Content Width', 'amazin' ), $boxed_width_slider, 'refresh', 29 ); // Single Content Width amazin_select_control( 'general', 'single_width', esc_html__( 'Single Content Width', 'amazin' ), $boxed_width_slider, 'refresh', 31 ); // Footer Width amazin_select_control( 'general', 'footer_width', esc_html__( 'Footer Width', 'amazin' ), $boxed_width, 'refresh', 33 ); // Pro Version $wp_customize->add_setting( 'pro_version_general_layouts', array( 'sanitize_callback' => 'amazin_sanitize_custom_control' ) ); $wp_customize->add_control( new Amazin_Customize_Pro_Version ( $wp_customize, 'pro_version_general_layouts', array( 'section' => 'amazin_general', 'type' => 'pro_options', 'label' => esc_html__( 'Layout Options', 'amazin' ), 'description' => esc_html( 'optimathemes.com/themes/amazin-pro?ref=amazin-free-general-layouts-customizer' ), 'priority' => 100 ) ) ); /* ** Top Bar ===== */ // add Top Bar section $wp_customize->add_section( 'amazin_top_bar' , array( 'title' => esc_html__( 'Top Bar', 'amazin' ), 'priority' => 5, 'capability' => 'edit_theme_options' ) ); // Top Bar label amazin_checkbox_control( 'top_bar', 'label', esc_html__( 'Top Bar', 'amazin' ), 'refresh', 1 ); /* ** Site Identity ===== */ // Logo Width amazin_number_absint_control( 'title_tagline', 'logo_width', esc_html__( 'Width', 'amazin' ), array( 'step' => '10' ), 'postMessage', 8 ); $wp_customize->get_control( 'custom_logo' )->transport = 'selective_refresh'; /* ** Main Navigation ===== */ // add Main Navigation section $wp_customize->add_section( 'amazin_main_nav' , array( 'title' => esc_html__( 'Main Navigation', 'amazin' ), 'priority' => 23, 'capability' => 'edit_theme_options' ) ); // Main Navigation amazin_checkbox_control( 'main_nav', 'label', esc_html__( 'Main Navigation', 'amazin' ), 'refresh', 1 ); $main_nav_align = array( 'left' => esc_html__( 'Left', 'amazin' ), 'center' => esc_html__( 'Center', 'amazin' ), 'right' => esc_html__( 'Right', 'amazin' ), ); // Align amazin_select_control( 'main_nav', 'align', esc_html__( 'Align', 'amazin' ), $main_nav_align, 'refresh', 7 ); $main_nav_position = array( 'above' => esc_html__( 'Above Page Header', 'amazin' ), 'below' => esc_html__( 'Below Page Header', 'amazin' ), ); // Show Search Icon amazin_checkbox_control( 'main_nav', 'show_search', esc_html__( 'Show Search Icon', 'amazin' ), 'refresh', 13 ); // Show Sidebar Icon amazin_checkbox_control( 'main_nav', 'show_sidebar', esc_html__( 'Show Sidebar Icon', 'amazin' ), 'refresh', 15 ); /* ** Featured Slider ===== */ // add featured slider section $wp_customize->add_section( 'amazin_featured_slider' , array( 'title' => esc_html__( 'Featured Slider', 'amazin' ), 'priority' => 25, 'capability' => 'edit_theme_options' ) ); // Featured Slider amazin_checkbox_control( 'featured_slider', 'label', esc_html__( 'Featured Slider', 'amazin' ), 'refresh', 1 ); $slider_display = array( 'all' => 'All Posts', 'category' => 'by Post Category' ); // Display amazin_select_control( 'featured_slider', 'display', esc_html__( 'Display Posts', 'amazin' ), $slider_display, 'refresh', 2 ); $slider_cats = array(); foreach ( get_categories() as $categories => $category ) { $slider_cats[$category->term_id] = $category->name; } // Category amazin_select_control( 'featured_slider', 'category', esc_html__( 'Select Category', 'amazin' ), $slider_cats, 'refresh', 3 ); // Amount amazin_number_absint_control( 'featured_slider', 'amount', esc_html__( 'Number of Slides', 'amazin' ), array( 'step' => '1', 'max' => '3' ), 'refresh', 10 ); $slider_culumns = array( 'step' => '1', 'min' => '1', 'max' => '4' ); // Navigation amazin_checkbox_control( 'featured_slider', 'navigation', esc_html__( 'Show Navigation Arrows', 'amazin' ), 'refresh', 25 ); // Pagination amazin_checkbox_control( 'featured_slider', 'pagination', esc_html__( 'Show Pagination Dots', 'amazin' ), 'refresh', 30 ); //Featured Slider Information class Amazin_Customize_Pro_Info extends WP_Customize_Control { public $type = 'pro_options'; public function render_content() { echo 'Note: Posts should have featured image for the slider to work.'; } } $wp_customize->add_setting( 'pro_version_featured_info', array( 'sanitize_callback' => 'amazin_sanitize_custom_control' ) ); $wp_customize->add_control( new Amazin_Customize_Pro_Info ( $wp_customize, 'pro_version_featured_info', array( 'section' => 'amazin_featured_slider', 'type' => 'pro_options', 'priority' => 100 ) ) ); $wp_customize->add_setting( 'pro_version_featured_slider', array( 'sanitize_callback' => 'amazin_sanitize_custom_control' ) ); $wp_customize->add_control( new Amazin_Customize_Pro_Version ( $wp_customize, 'pro_version_featured_slider', array( 'section' => 'amazin_featured_slider', 'type' => 'pro_options', 'label' => esc_html__( 'Slider Options ', 'amazin' ), 'description' => esc_html( 'optimathemes.com/themes/amazin-pro?ref=amazin-free-featured-slider-customizer' ), 'priority' => 100 ) ) ); /* ** Featured Links ===== */ // add featured links section $wp_customize->add_section( 'amazin_featured_links' , array( 'title' => esc_html__( 'Featured Links', 'amazin' ), 'priority' => 27, 'capability' => 'edit_theme_options' ) ); // Featured Links amazin_checkbox_control( 'featured_links', 'label', esc_html__( 'Featured Links', 'amazin' ), 'refresh', 1 ); // Link #1 Title amazin_text_control( 'featured_links', 'title_1', esc_html__( 'Title', 'amazin' ), 'refresh', 9 ); // Link #1 URL amazin_url_control( 'featured_links', 'url_1', esc_html__( 'URL', 'amazin' ), 'refresh', 11 ); // Link #1 Image amazin_image_crop_control( 'featured_links', 'image_1', esc_html__( 'Image', 'amazin' ), 600, 340, 'refresh', 13 ); // Link #2 Title amazin_text_control( 'featured_links', 'title_2', esc_html__( 'Title', 'amazin' ), 'refresh', 15 ); // Link #2 URL amazin_url_control( 'featured_links', 'url_2', esc_html__( 'URL', 'amazin' ), 'refresh', 17 ); // Link #2 Image amazin_image_crop_control( 'featured_links', 'image_2', esc_html__( 'Image', 'amazin' ), 600, 340, 'refresh', 19 ); // Link #3 Title amazin_text_control( 'featured_links', 'title_3', esc_html__( 'Title', 'amazin' ), 'refresh', 21 ); // Link #3 URL amazin_url_control( 'featured_links', 'url_3', esc_html__( 'URL', 'amazin' ), 'refresh', 23 ); // Link #3 Image amazin_image_crop_control( 'featured_links', 'image_3', esc_html__( 'Image', 'amazin' ), 600, 340, 'refresh', 25 ); /* ** Blog Page ===== */ // add Blog Page section $wp_customize->add_section( 'amazin_blog_page' , array( 'title' => esc_html__( 'Blog Page', 'amazin' ), 'priority' => 29, 'capability' => 'edit_theme_options' ) ); $post_description = array( 'none' => esc_html__( 'None', 'amazin' ), 'excerpt' => esc_html__( 'Post Excerpt', 'amazin' ), 'content' => esc_html__( 'Post Content', 'amazin' ), ); // Post Description amazin_select_control( 'blog_page', 'post_description', esc_html__( 'Post Description', 'amazin' ), $post_description, 'refresh', 3 ); $post_pagination = array( 'default' => esc_html__( 'Default', 'amazin' ), 'numeric' => esc_html__( 'Numeric', 'amazin' ), ); // Post Pagination amazin_select_control( 'blog_page', 'post_pagination', esc_html__( 'Post Pagination', 'amazin' ), $post_pagination, 'refresh', 5 ); // Show Categories amazin_checkbox_control( 'blog_page', 'show_categories', esc_html__( 'Show Categories', 'amazin' ), 'refresh', 6 ); // Show Date amazin_checkbox_control( 'blog_page', 'show_date', esc_html__( 'Show Date', 'amazin' ), 'refresh', 7 ); // Show Comments amazin_checkbox_control( 'blog_page', 'show_comments', esc_html__( 'Show Comments', 'amazin' ), 'refresh', 9 ); // Show Drop Caps amazin_checkbox_control( 'blog_page', 'show_dropcaps', esc_html__( 'Show Drop Caps', 'amazin' ), 'refresh', 11 ); // Show Author amazin_checkbox_control( 'blog_page', 'show_author', esc_html__( 'Show Author', 'amazin' ), 'refresh', 16 ); $related_posts = array( 'none' => esc_html__( 'None', 'amazin' ), 'related' => esc_html__( 'Related', 'amazin' ) ); // Related Posts Orderby amazin_select_control( 'blog_page', 'related_orderby', esc_html__( 'Related Posts Display', 'amazin' ), $related_posts, 'refresh', 33 ); // Pro Version $wp_customize->add_setting( 'pro_version_blog_page', array( 'sanitize_callback' => 'amazin_sanitize_custom_control' ) ); $wp_customize->add_control( new Amazin_Customize_Pro_Version ( $wp_customize, 'pro_version_blog_page', array( 'section' => 'amazin_blog_page', 'type' => 'pro_options', 'label' => esc_html__( 'Blog Options ', 'amazin' ), 'description' => esc_html( 'optimathemes.com/themes/amazin-pro?ref=amazin-free-blog-page-customizer' ), 'priority' => 100 ) ) ); /* ** Single Page ===== */ // add single Page section $wp_customize->add_section( 'amazin_single_page' , array( 'title' => esc_html__( 'Single Page', 'amazin' ), 'priority' => 31, 'capability' => 'edit_theme_options' ) ); // Show Categories amazin_checkbox_control( 'single_page', 'show_categories', esc_html__( 'Show Categories', 'amazin' ), 'refresh', 5 ); // Show Date amazin_checkbox_control( 'single_page', 'show_date', esc_html__( 'Show Date', 'amazin' ), 'refresh', 7 ); // Show Comments amazin_checkbox_control( 'single_page', 'show_comments', esc_html__( 'Show Comments', 'amazin' ), 'refresh', 13 ); // Show Author amazin_checkbox_control( 'single_page', 'show_author', esc_html__( 'Show Author', 'amazin' ), 'refresh', 15 ); // Show Author Description amazin_checkbox_control( 'single_page', 'show_author_desc', esc_html__( 'Show Author Description', 'amazin' ), 'refresh', 18 ); // Related Posts Orderby amazin_select_control( 'single_page', 'related_orderby', esc_html__( 'Related Posts - Display', 'amazin' ), $related_posts, 'refresh', 23 ); /* ** Social Media ===== */ // add social media section $wp_customize->add_section( 'amazin_social_media' , array( 'title' => esc_html__( 'Social Media', 'amazin' ), 'priority' => 33, 'capability' => 'edit_theme_options' ) ); // Social Window amazin_checkbox_control( 'social_media', 'window', esc_html__( 'Show Social Icons in New Window', 'amazin' ), 'refresh', 1 ); // Social Icons Array $social_icons = array( 'facebook' => '', 'facebook-official' => '', 'facebook-square' => '', 'twitter' => '', 'twitter-square' => '', 'google' => '', 'google-plus' => '', 'google-plus-official' => '', 'google-plus-square' => '', 'linkedin' => '', 'linkedin-square' => '', 'pinterest' => '', 'pinterest-p' => '', 'pinterest-square' => '', 'behance' => '', 'behance-square' => '', 'tumblr' => '', 'tumblr-square' => '', 'reddit' => '', 'reddit-alien' => '', 'reddit-square' => '', 'dribbble' => '', 'vk' => '', 'skype' => '', 'film' => '', 'youtube-play' => '', 'youtube' => '', 'youtube-square' => '', 'vimeo-square' => '', 'soundcloud' => '', 'instagram' => '', 'flickr' => '', 'rss' => '', 'rss-square' => '', 'heart' => '', 'heart-o' => '', 'github' => '', 'github-alt' => '', 'github-square' => '', 'stack-overflow' => '', 'qq' => '', 'weibo' => '', 'weixin' => '', 'xing' => '', 'xing-square' => '', 'gamepad' => '', 'medium' => '', 'envelope' => '', 'envelope-o' => '', 'envelope-square ' => '', 'etsy' => '', 'snapchat' => '', 'snapchat-ghost' => '', 'snapchat-square' => '', 'meetup' => '', ); // Social #1 Icon amazin_select_control( 'social_media', 'icon_1', esc_html__( 'Select Icon', 'amazin' ), $social_icons, 'refresh', 3 ); // Social #1 Icon amazin_url_control( 'social_media', 'url_1', esc_html__( 'URL', 'amazin' ), 'refresh', 5 ); // Social #2 Icon amazin_select_control( 'social_media', 'icon_2', esc_html__( 'Select Icon', 'amazin' ), $social_icons, 'refresh', 7 ); // Social #2 Icon amazin_url_control( 'social_media', 'url_2', esc_html__( 'URL', 'amazin' ), 'refresh', 9 ); // Social #3 Icon amazin_select_control( 'social_media', 'icon_3', esc_html__( 'Select Icon', 'amazin' ), $social_icons, 'refresh', 11 ); // Social #3 Icon amazin_url_control( 'social_media', 'url_3', esc_html__( 'URL', 'amazin' ), 'refresh', 13 ); // Social #4 Icon amazin_select_control( 'social_media', 'icon_4', esc_html__( 'Select Icon', 'amazin' ), $social_icons, 'refresh', 15 ); // Social #4 Icon amazin_url_control( 'social_media', 'url_4', esc_html__( 'URL', 'amazin' ), 'refresh', 17 ); /* ** Page Footer ===== */ // add page footer section $wp_customize->add_section( 'amazin_page_footer' , array( 'title' => esc_html__( 'Page Footer', 'amazin' ), 'priority' => 35, 'capability' => 'edit_theme_options' ) ); $copyright_description = 'Enter $year to update the year automatically and $copy for the copyright symbol.

Example: $year Amazin Theme $copy.'; // Copyright amazin_textarea_control( 'page_footer', 'copyright', esc_html__( 'Copyright', 'amazin' ), $copyright_description, 'refresh', 3 ); // Pro Version $wp_customize->add_setting( 'pro_version_page_footer', array( 'sanitize_callback' => 'amazin_sanitize_custom_control' ) ); $wp_customize->add_control( new Amazin_Customize_Pro_Version ( $wp_customize, 'pro_version_page_footer', array( 'section' => 'amazin_page_footer', 'type' => 'pro_options', 'label' => esc_html__( 'Footer Options', 'amazin' ), 'description' => esc_html( 'optimathemes.com/themes/amazin/customizer/free/page-footer.html?ref=amazin-free-page-footer-customizer' ), 'priority' => 100 ) ) ); /* ** Preloader ===== */ // add Preloader section $wp_customize->add_section( 'amazin_preloader' , array( 'title' => esc_html__( 'Preloader', 'amazin' ), 'priority' => 45, 'capability' => 'edit_theme_options' ) ); // Preloading Animation amazin_checkbox_control( 'preloader', 'label', esc_html__( 'Preloading Animation', 'amazin' ), 'refresh', 1 ); } add_action( 'customize_register', 'amazin_customize_register' ); /* ** Bind JS handlers to instantly live-preview changes */ function amazin_customize_preview_js() { wp_enqueue_script( 'amazin-customize-preview', get_theme_file_uri( '/inc/customizer/js/customize-preview.js' ), array( 'customize-preview' ), '1.0', true ); } add_action( 'customize_preview_init', 'amazin_customize_preview_js' ); /* ** Load dynamic logic for the customizer controls area. */ function amazin_panels_js() { wp_enqueue_style( 'fontawesome', get_theme_file_uri( '/assets/css/font-awesome.css' ) ); wp_enqueue_style( 'amazin-customizer-ui-css', get_theme_file_uri( '/inc/customizer/css/customizer-ui.css' ) ); wp_enqueue_script( 'amazin-customize-controls', get_theme_file_uri( '/inc/customizer/js/customize-controls.js' ), array(), '1.0', true ); } add_action( 'customize_controls_enqueue_scripts', 'amazin_panels_js' );