add_section( 'bongoto_shop_section_footer', array( 'title' => __( 'Footer', 'bongoto-shop' ), 'priority' => 60, 'panel' => 'bongoto_general_panel', 'description' => $pro_active ? __( 'Footer layout and copyright settings.', 'bongoto-shop' ) : __( 'Footer layout settings. (Copyright text is editable in Bongoto Shop Pro)', 'bongoto-shop' ), ) ); /* ===== Subscribe bar toggle ===== */ $wp_customize->add_setting( 'bongoto_shop_footer_show_subscribe', array( 'default' => true, 'sanitize_callback' => 'bongoto_shop_customize_sanitize_checkbox', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'bongoto_shop_footer_show_subscribe', array( 'label' => __( 'Show Subscribe Section', 'bongoto-shop' ), 'description' => __( 'Toggle display of the subscribe bar above the footer.', 'bongoto-shop' ), 'section' => 'bongoto_shop_section_footer', 'type' => 'checkbox', ) ); /* ===== Footer widgets toggle ===== */ $wp_customize->add_setting( 'bongoto_shop_footer_widgets_enabled', array( 'default' => true, 'sanitize_callback' => 'bongoto_shop_customize_sanitize_checkbox', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'bongoto_shop_footer_widgets_enabled', array( 'label' => __( 'Enable Footer Widgets', 'bongoto-shop' ), 'description' => __( 'Allow widget areas in footer columns.', 'bongoto-shop' ), 'section' => 'bongoto_shop_section_footer', 'type' => 'checkbox', ) ); /* ===== Columns (1–6) ===== */ $wp_customize->add_setting( 'bongoto_shop_footer_columns', array( 'default' => 4, 'sanitize_callback' => function ( $v ) { return bongoto_shop_sanitize_int_range( $v, 1, 6, 4 ); }, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'bongoto_shop_footer_columns', array( 'label' => __( 'Footer Columns', 'bongoto-shop' ), 'description' => __( 'Number of widget columns in the footer.', 'bongoto-shop' ), 'section' => 'bongoto_shop_section_footer', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 6, 'step' => 1, ), ) ); /* ===== Pro-only controls ===== */ if ( $pro_active ) { // Copyright — base line (tokens). $wp_customize->add_setting( 'bongoto_shop_footer_copyright_base', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'bongoto_shop_footer_copyright_base', array( 'label' => __( 'Copyright — Base Line', 'bongoto-shop' ), /* translators: tokens {year}, {site} */ 'description' => __( 'Override the default copyright line. Tokens: {year}, {site}. Example: "© {year} {site}. All rights reserved."', 'bongoto-shop' ), 'section' => 'bongoto_shop_section_footer', 'type' => 'text', ) ); // Powered by — show. $wp_customize->add_setting( 'bongoto_shop_footer_powered_show', array( 'default' => true, 'sanitize_callback' => 'bongoto_shop_customize_sanitize_checkbox', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'bongoto_shop_footer_powered_show', array( /* translators: label for toggle */ 'label' => __( 'Show “Powered by”', 'bongoto-shop' ), 'section' => 'bongoto_shop_section_footer', 'type' => 'checkbox', ) ); // Powered by — text. $wp_customize->add_setting( 'bongoto_shop_footer_powered_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'bongoto_shop_footer_powered_text', array( 'label' => __( 'Powered by — Text', 'bongoto-shop' ), /* translators: default fallback text description */ 'description' => __( 'Leave blank to use the default: Powered by Bongoto Shop Theme.', 'bongoto-shop' ), 'section' => 'bongoto_shop_section_footer', 'type' => 'text', ) ); // Powered by — URL. $wp_customize->add_setting( 'bongoto_shop_footer_powered_url', array( 'default' => 'https://bongoto.com/', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'bongoto_shop_footer_powered_url', array( 'label' => __( 'Powered by — URL', 'bongoto-shop' ), 'section' => 'bongoto_shop_section_footer', 'type' => 'url', ) ); // Extra copyright text (HTML allowed). $wp_customize->add_setting( 'bongoto_shop_footer_copyright_text', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'bongoto_shop_footer_copyright_text', array( 'label' => __( 'Copyright — Extra Text', 'bongoto-shop' ), 'description' => __( 'Shown under the base line. Basic HTML allowed (e.g., links).', 'bongoto-shop' ), 'section' => 'bongoto_shop_section_footer', 'type' => 'textarea', ) ); // Selective refresh preview (base/powered/extra). if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'bongoto_shop_footer_copyright_partial', array( 'selector' => '.bt-footer-copyright', 'settings' => array( 'bongoto_shop_footer_copyright_base', 'bongoto_shop_footer_powered_show', 'bongoto_shop_footer_powered_text', 'bongoto_shop_footer_powered_url', 'bongoto_shop_footer_copyright_text', ), 'render_callback' => function () { get_template_part( 'template-parts/footers/components/copyright' ); }, ) ); } } } add_action( 'customize_register', 'bongoto_shop_customize_register_footer', 40 );