add_panel( 'bizstrait_header_setting', array( 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( 'Header', 'bizstrait' ), ) ); /*--- Title Tagline ----*/ $wp_customize->add_section( 'title_tagline', array( 'priority' => 1, 'title' => __( 'Site Identity', 'bizstrait' ), 'panel' => 'bizstrait_header_setting', ) ); $wp_customize->add_section( 'top_header', array( // 'priority' => 12, 'title' => __( 'Top Header', 'bizstrait' ), 'panel' => 'bizstrait_header_setting', ) ); $wp_customize->add_setting( 'menu_inline_btn_enable_disable', array( 'default' => '1', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizstrait_switch_sanitization', ) ); $wp_customize->add_control( new Bizstrait_Toggle_Switch_Custom_Control( $wp_customize, 'menu_inline_btn_enable_disable', array( 'label' => __( 'Menu Button', 'bizstrait' ), 'priority' => 14, 'section' => 'top_header', ) ) ); $wp_customize->add_setting( 'menu_inline_btn_text', array( 'default' => __( 'Lorem', 'bizstrait' ), 'sanitize_callback' => 'sanitize_textarea_field', ) ); $wp_customize->add_control( 'menu_inline_btn_text', array( 'label' => __( 'Button Text', 'bizstrait' ), 'section' => 'top_header', 'type' => 'text', 'priority' => 15, 'input_attrs' => array( 'class' => 'my-custom-class', 'style' => 'border: 1px solid rebeccapurple', ), ) ); $wp_customize->add_setting( 'menu_inline_btn_link', array( 'capability' => 'edit_theme_options', 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'menu_inline_btn_link', array( 'label' => __( 'Link', 'bizstrait' ), 'priority' => 15, 'section' => 'top_header', 'type' => 'text', ) ); /** * Search */ $wp_customize->add_setting( 'topbar_search_icon_display', array( 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'bizstrait_switch_sanitization', ) ); $wp_customize->add_control( new Bizstrait_Toggle_Switch_Custom_Control( $wp_customize, 'topbar_search_icon_display', array( 'priority' => 12, 'label' => __( 'Search icon', 'bizstrait' ), 'section' => 'top_header', ) ) ); /** * Scrollbar */ $wp_customize->add_section( 'bizstrait_scrollbar_btn', array( 'title' => __( 'Scrollbar Button', 'bizstrait' ), 'panel' => 'bizstrait_gen_setting', // 'priority' => 0, ) ); $wp_customize->add_setting( 'scrollbar_display', array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'bizstrait_switch_sanitization', ) ); $wp_customize->add_control( new Bizstrait_Toggle_Switch_Custom_Control( $wp_customize, 'scrollbar_display', array( 'priority' => 1, 'label' => __( 'Display', 'bizstrait' ), 'section' => 'bizstrait_scrollbar_btn', ) ) ); $wp_customize->selective_refresh->add_partial( 'scrollbar_display', array( 'selector' => 'body > a.scrollup', 'settings' => 'scrollbar_display', 'render_callback' => function () { return get_theme_mod( 'scrollbar_display' ); }, ) ); $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => 'header > div.nav-wapper > nav > div > div.site-branding-text > h1', 'settings' => 'blogname', 'render_callback' => function () { return get_theme_mod( 'blogname' ); }, ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => 'header > div.nav-wapper > nav > div > div.site-branding-text > p', 'settings' => 'blogdescription', 'render_callback' => function () { return get_theme_mod( 'blogdescription' ); }, ) ); $wp_customize->selective_refresh->add_partial( 'menu_inline_btn_link', array( 'selector' => '.nav-wap .search > a', 'settings' => 'menu_inline_btn_link', 'render_callback' => function () { return get_theme_mod( 'menu_inline_btn_link' ); }, ) ); $wp_customize->selective_refresh->add_partial( 'custom_logo', array( 'selector' => 'header > div.nav-wapper > nav > div > a', 'settings' => 'custom_logo', 'render_callback' => function () { return get_theme_mod( 'custom_logo' ); }, ) ); $wp_customize->get_section( 'header_image' )->panel = 'bizstrait_header_setting'; $wp_customize->get_section( 'header_image' )->title = __( 'Breadcrumb background', 'bizstrait' ); $wp_customize->get_section( 'header_image' )->priority = 999; } add_action( 'customize_register', 'bizstrait_header_customizer_setting' );