add_section( 'bongoto_section_footer', array( 'title' => __( 'Footer', 'bongoto' ), 'priority' => 60, 'description' => $pro_active ? __( 'Footer layout and copyright settings.', 'bongoto' ) : __( 'Footer layout settings. (Copyright text is editable in Bongoto Pro)', 'bongoto' ), ) ); // Subscribe toggle $wp_customize->add_setting( 'bongoto_footer_show_subscribe', array( 'default' => true, 'sanitize_callback' => 'bongoto_customize_sanitize_checkbox', 'transport' => 'refresh', )); $wp_customize->add_control( 'bongoto_footer_show_subscribe', array( 'label' => __( 'Show Subscribe Section', 'bongoto' ), 'description' => __( 'Toggle display of the subscribe bar above footer.', 'bongoto' ), 'section' => 'bongoto_section_footer', 'type' => 'checkbox', )); // Footer widgets toggle $wp_customize->add_setting( 'bongoto_footer_widgets_enabled', array( 'default' => true, 'sanitize_callback' => 'bongoto_customize_sanitize_checkbox', 'transport' => 'refresh', )); $wp_customize->add_control( 'bongoto_footer_widgets_enabled', array( 'label' => __( 'Enable Footer Widgets', 'bongoto' ), 'description' => __( 'Allow widget areas in footer columns.', 'bongoto' ), 'section' => 'bongoto_section_footer', 'type' => 'checkbox', )); // Columns $wp_customize->add_setting( 'bongoto_footer_columns', array( 'default' => 4, 'sanitize_callback' => function( $v ){ return bongoto_sanitize_int_range( $v, 1, 6, 4 ); }, 'transport' => 'refresh', )); $wp_customize->add_control( 'bongoto_footer_columns', array( 'label' => __( 'Footer Columns', 'bongoto' ), 'description' => __( 'Number of widget columns in footer.', 'bongoto' ), 'section' => 'bongoto_section_footer', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 6, 'step' => 1 ), )); /* ===== Pro-only controls ===== */ if ( $pro_active ) { // Base Line (tokens) $wp_customize->add_setting( 'bongoto_footer_copyright_base', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post', 'transport' => 'postMessage', )); $wp_customize->add_control( 'bongoto_footer_copyright_base', array( 'label' => __( 'Copyright – Base Line', 'bongoto' ), 'description' => __( 'Override the default copyright line. Tokens: {year}, {site}. Example: "© {year} {site}. All rights reserved."', 'bongoto' ), 'section' => 'bongoto_section_footer', 'type' => 'text', )); // Powered by: show $wp_customize->add_setting( 'bongoto_footer_powered_show', array( 'default' => true, 'sanitize_callback' => 'bongoto_customize_sanitize_checkbox', 'transport' => 'postMessage', )); $wp_customize->add_control( 'bongoto_footer_powered_show', array( 'label' => __( 'Show “Powered by”', 'bongoto' ), 'section' => 'bongoto_section_footer', 'type' => 'checkbox', )); // Powered by: text $wp_customize->add_setting( 'bongoto_footer_powered_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', )); $wp_customize->add_control( 'bongoto_footer_powered_text', array( 'label' => __( 'Powered by – Text', 'bongoto' ), 'description' => __( 'Leave blank to use the default: Powered by Bongoto Theme.', 'bongoto' ), 'section' => 'bongoto_section_footer', 'type' => 'text', )); // Powered by: url $wp_customize->add_setting( 'bongoto_footer_powered_url', array( 'default' => 'https://bongoto.com/product/bongoto-pro-digital-marketplace-addon/', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', )); $wp_customize->add_control( 'bongoto_footer_powered_url', array( 'label' => __( 'Powered by – URL', 'bongoto' ), 'section' => 'bongoto_section_footer', 'type' => 'url', )); // Extra text under base line $wp_customize->add_setting( 'bongoto_footer_copyright_text', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post', 'transport' => 'postMessage', )); $wp_customize->add_control( 'bongoto_footer_copyright_text', array( 'label' => __( 'Copyright – Extra Text', 'bongoto' ), 'description' => __( 'Shown under the base line. Basic HTML allowed (e.g., links).', 'bongoto' ), 'section' => 'bongoto_section_footer', 'type' => 'textarea', )); // Live preview (base, powered, extra) if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'bongoto_footer_copyright_partial', array( 'selector' => '.bt-footer-copyright', 'settings' => array( 'bongoto_footer_copyright_base', 'bongoto_footer_powered_show', 'bongoto_footer_powered_text', 'bongoto_footer_powered_url', 'bongoto_footer_copyright_text', ), 'render_callback' => function () { get_template_part( 'template-parts/footers/components/copyright' ); }, ) ); } } } add_action( 'customize_register', 'bongoto_customize_register_footer', 40 );