add_section( 'acommerce_main_header_section', array( 'title' => esc_html__( 'Main Header', 'acommerce' ), 'priority' => 2, 'panel' =>'header_setting' ) ); //Header User Section $wp_customize->add_setting( 'acommerce_user_header_enable', array( 'default' => true, 'sanitize_callback' => 'acommerce_sanitize_checkbox', ) ); $wp_customize->add_control( new aCommerce_Toggle_Control( $wp_customize, 'acommerce_user_header_enable', array( 'section' => 'acommerce_main_header_section', 'label' => esc_html__( 'Show Header User Section', 'acommerce' ), 'description' => esc_html__( 'Toggle Show/Hide user section.', 'acommerce' ), 'priority' => 1 ) ) ); //Header User Section $wp_customize->add_setting( 'acommerce_user_header_position', array( 'default' => true, 'sanitize_callback' => 'acommerce_sanitize_checkbox', ) ); $wp_customize->add_control( new aCommerce_Toggle_Control( $wp_customize, 'acommerce_user_header_position', array( 'section' => 'acommerce_main_header_section', 'label' => esc_html__( 'Show Header Absolute', 'acommerce' ), 'description' => esc_html__( 'Show Header Absolute and relative.', 'acommerce' ), 'priority' => 1 ) ) ); //Header Cart Section $wp_customize->add_setting( 'acommerce_header_cart_enable', array( 'default' =>true, 'sanitize_callback' => 'acommerce_sanitize_checkbox', ) ); $wp_customize->add_control( new aCommerce_Toggle_Control( $wp_customize, 'acommerce_header_cart_enable', array( 'section' => 'acommerce_main_header_section', 'label' => esc_html__( 'Show Header Cart Section', 'acommerce' ), 'description' => esc_html__( 'Toggle Show/Hide header cart section.', 'acommerce' ), 'priority' => 3 ) ) ); //Header Search Section $wp_customize->add_setting( 'acommerce_header_search_enable', array( 'sanitize_callback' => 'acommerce_sanitize_checkbox', ) ); $wp_customize->add_control( new aCommerce_Toggle_Control( $wp_customize, 'acommerce_header_search_enable', array( 'section' => 'acommerce_main_header_section', 'label' => esc_html__( 'Show Header Search Section', 'acommerce' ), 'description' => esc_html__( 'Toggle Show/Hide header search section.', 'acommerce' ), 'priority' => 4 ) ) ); //Logo section call $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; //Header pare refresh section if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'acommerce_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'acommerce_customize_partial_blogdescription', ) ); } } add_action( 'customize_register', 'acommerce_customize_archive_main_header_settings' );