add_section( 'begro_general_section', array( 'title' => __( 'General Settings', 'begro' ), 'priority' => 5, ) ); // Enable Classic Widgets $wp_customize->add_setting( 'begro_classic_widgets_enable', array( 'default' => 0, 'sanitize_callback' => 'begro_sanitize_checkbox', ) ); $wp_customize->add_control( 'begro_classic_widgets_enable', array( 'label' => __( 'Enable Classic Widgets', 'begro' ), 'type' => 'checkbox', 'section' => 'begro_general_section', ) ); // Enable Classic Editor $wp_customize->add_setting( 'begro_classic_editor_enable', array( 'default' => 0, 'sanitize_callback' => 'begro_sanitize_checkbox', ) ); $wp_customize->add_control( 'begro_classic_editor_enable', array( 'label' => __( 'Enable Classic Editor', 'begro' ), 'type' => 'checkbox', 'section' => 'begro_general_section', ) ); // Panel: Header Options $wp_customize->add_panel( 'begro_header_panel', array( 'title' => __( 'Header Options', 'begro' ), 'description' => __( 'Customize header layouts and topbar', 'begro' ), 'priority' => 20, ) ); // PADDING - TOP $wp_customize->add_setting( 'begro_topbar_pad_top', array( 'default' => '0px', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'begro_topbar_pad_top', array( 'label' => __( 'Padding Top', 'begro' ), 'type' => 'text', 'section' => 'begro_topbar_section', 'input_attrs' => array( 'placeholder' => '10px' ), ) ); // PADDING RIGHT $wp_customize->add_setting( 'begro_topbar_pad_right', array( 'default' => '0px', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'begro_topbar_pad_right', array( 'label' => __( 'Padding Right', 'begro' ), 'type' => 'text', 'section' => 'begro_topbar_section', 'input_attrs' => array( 'placeholder' => '10px' ), ) ); /** * TOPBAR COLORS */ // Topbar Background Color $wp_customize->add_setting( 'begro_topbar_bg_color', array( 'default' => '#f5f5f5', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'begro_topbar_bg_color', array( 'label' => __( 'Topbar Background Color', 'begro' ), 'section' => 'begro_topbar_section', ) ) ); // Topbar Text Color $wp_customize->add_setting( 'begro_topbar_text_color', array( 'default' => '#333333', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'begro_topbar_text_color', array( 'label' => __( 'Topbar Text Color', 'begro' ), 'section' => 'begro_topbar_section', ) ) ); /** * MARQUEE COLORS */ // Marquee Background $wp_customize->add_setting( 'begro_marquee_bg_color', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'begro_marquee_bg_color', array( 'label' => __( 'Marquee Background Color', 'begro' ), 'section' => 'begro_topbar_section', ) ) ); // Marquee Text Color $wp_customize->add_setting( 'begro_marquee_text_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'begro_marquee_text_color', array( 'label' => __( 'Marquee Text Color', 'begro' ), 'section' => 'begro_topbar_section', ) ) ); // Marquee Link Color $wp_customize->add_setting( 'begro_marquee_link_color', array( 'default' => '#ffcc00', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'begro_marquee_link_color', array( 'label' => __( 'Marquee Link Color', 'begro' ), 'section' => 'begro_topbar_section', ) ) ); // Section: Topbar Settings $wp_customize->add_section( 'begro_topbar_section', array( 'title' => __( 'Topbar Settings', 'begro' ), 'panel' => 'begro_header_panel', 'priority' => 10, ) ); $wp_customize->add_setting( 'begro_topbar_enable', array( 'default' => 0, 'sanitize_callback' => 'begro_sanitize_checkbox', ) ); $wp_customize->add_control( 'begro_topbar_enable', array( 'label' => __( 'Enable Topbar', 'begro' ), 'type' => 'checkbox', 'section' => 'begro_topbar_section', ) ); // Optional: topbar text/email fields $wp_customize->add_setting( 'begro_topbar_text', array( 'default' => __( 'Welcome to our site!', 'begro' ), 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'begro_topbar_text', array( 'label' => __( 'Marquee Text', 'begro' ), 'type' => 'text', 'section' => 'begro_topbar_section', ) ); $wp_customize->add_setting( 'begro_topbar_link', array( 'default' => __( 'Welcome to our site!', 'begro' ), 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'begro_topbar_link', array( 'label' => __( 'Marquee Link ', 'begro' ), 'type' => 'link', 'section' => 'begro_topbar_section', ) ); // Section: Header Layout $wp_customize->add_section( 'begro_header_section', array( 'title' => __( 'Header Layout', 'begro' ), 'panel' => 'begro_header_panel', 'priority' => 20, ) ); $wp_customize->add_setting( 'begro_header_layout', array( 'default' => 'layout1', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'begro_header_layout', array( 'label' => __( 'Select Header Layout', 'begro' ), 'type' => 'select', 'section' => 'begro_header_section', 'choices' => array( 'layout1' => __( 'Layout 1', 'begro' ), 'layout2' => __( 'Layout 2', 'begro' ), 'layout3' => __( 'Layout 3', 'begro' ), ), ) ); /** * Logo settings inside Site Identity */ // === LOGO UPLOAD === // // === DESKTOP LOGO HEIGHT === // $wp_customize->add_setting( 'begro_logo_height', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'begro_logo_height', array( 'type' => 'text', 'section' => 'title_tagline', 'label' => __( 'Desktop Logo Height', 'begro' ), 'description' => __( 'Example: 80px, 2em, 100%', 'begro' ), 'priority' => 30, 'input_attrs' => array( 'placeholder' => __( '80px', 'begro' ), ), ) ); // === MOBILE LOGO HEIGHT === // $wp_customize->add_setting( 'begro_mlogo_height', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'begro_mlogo_height', array( 'type' => 'text', 'section' => 'title_tagline', 'label' => __( 'Mobile Logo Height', 'begro' ), 'description' => __( 'Example: 60px, 2em, 100%', 'begro' ), 'priority' => 31, 'input_attrs' => array( 'placeholder' => __( '60px', 'begro' ), ), ) ); } add_action( 'customize_register', 'begro_customize_register' );