get_section( 'bongoto_woocommerce_section_general' ) ) { $wp_customize->add_section( 'bongoto_woocommerce_section_general', array( 'title' => __( 'General', 'bongoto-woocommerce' ), 'priority' => 10, 'panel' => 'bongoto_woocommerce_panel', ) ); } $colors = array( array( 'id' => 'bongoto_woocommerce_color_primary', 'label' => __( 'Primary Color', 'bongoto-woocommerce' ), 'default' => '#2563eb', ), array( 'id' => 'bongoto_woocommerce_color_accent', 'label' => __( 'Accent Color', 'bongoto-woocommerce' ), 'default' => '#10b981', ), array( 'id' => 'bongoto_woocommerce_color_text', 'label' => __( 'Text Color', 'bongoto-woocommerce' ), 'default' => '#111827', ), array( 'id' => 'bongoto_woocommerce_color_bg', 'label' => __( 'Background', 'bongoto-woocommerce' ), 'default' => '#ffffff', ), ); foreach ( $colors as $c ) { $wp_customize->add_setting( $c['id'], array( 'default' => $c['default'], 'transport' => 'postMessage', 'sanitize_callback' => 'bongoto_woocommerce_sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $c['id'], array( 'label' => $c['label'], 'section' => 'bongoto_woocommerce_section_general', 'settings' => $c['id'], ) ) ); } } add_action( 'customize_register', 'bongoto_woocommerce_customize_register_general', 20 );