add_panel( 'blogtay_header', array( 'title' => __( 'Header', 'blogtay' ), 'priority' => 10, // Mixed with top-level-section hierarchy. ) ); //************************ social media ********************** $wp_customize->add_section( 'blogtay_social' , array( 'title' => __('Social Media', 'blogtay'), 'panel' => 'blogtay_header', ) ); $wp_customize->add_setting( 'theme_options[blogtay_social_media_1]', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'theme_options[blogtay_social_media_1]', array( 'label' => __( 'Social Media 1', 'blogtay'), 'description' => __( 'Enter url', 'blogtay' ), 'section' => 'blogtay_social', 'type' => 'url' ) ); $wp_customize->add_setting( 'theme_options[blogtay_social_media_2]', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'theme_options[blogtay_social_media_2]', array( 'label' => __( 'Social Media 2', 'blogtay' ), 'description' => __( 'Enter url.', 'blogtay' ), 'section' => 'blogtay_social', 'type' => 'url' ) ); $wp_customize->add_setting( 'theme_options[blogtay_social_media_3]', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'theme_options[blogtay_social_media_3]', array( 'label' => __( 'Social Media 3', 'blogtay' ), 'description' => __( 'Enter url.', 'blogtay' ), 'section' => 'blogtay_social', 'type' => 'url' ) ); //************************ Info ********************** $wp_customize->add_section( 'blogtay_top_header_info' , array( 'title' => __('Info', 'blogtay'), 'panel' => 'blogtay_header', ) ); $wp_customize->add_setting( 'theme_options[blogtay_top_number]', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'theme_options[blogtay_top_number]', array( 'label' => __( 'Contact Number', 'blogtay'), 'section' => 'blogtay_top_header_info', 'type' => 'number' ) ); $wp_customize->add_setting( 'theme_options[blogtay_top_email]', array( 'sanitize_callback' => 'sanitize_email' ) ); $wp_customize->add_control( 'theme_options[blogtay_top_email]', array( 'label' => __( 'Email Address', 'blogtay'), 'section' => 'blogtay_top_header_info', 'type' => 'email' ) ); //************************ Show/hide ********************** if (!function_exists('blogtay_show_hide_section')) : function blogtay_show_hide_section() { $blogtay_show_hide_section = array( 'show' => esc_html__('Show', 'blogtay'), 'hide' => esc_html__('Hide', 'blogtay') ); return apply_filters('blogtay_show_hide_section', $blogtay_show_hide_section); } endif; if (!function_exists('blogtay_sanitize_show_hide_section')) : function blogtay_sanitize_show_hide_section( $input, $setting ){ $input = sanitize_key($input); $choices = $setting->manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } endif; $wp_customize->add_section( 'blogtay_top_header' , array( 'title' => __('Top header Show/Hide', 'blogtay'), 'panel' => 'blogtay_header', ) ); $wp_customize->add_setting( 'theme_options[blogtay_show_hide_option]', array( 'default' => 'show', 'sanitize_callback' => 'blogtay_sanitize_show_hide_section', ) ); $blogtay_show_hide_section = blogtay_show_hide_section(); $wp_customize->add_control( 'theme_options[blogtay_show_hide_option]', array( 'label' => __( 'Top header section show/hide.','blogtay'), 'section' => 'blogtay_top_header', 'type' => 'radio', 'choices' => $blogtay_show_hide_section ) );