add_panel( 'bizstrait_footer_setting', array( // 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( 'Footer', 'bizstrait' ), ) ); $wp_customize->add_section( 'bizstrait_footer_bar', array( 'title' => __( 'Footer Bar', 'bizstrait' ), 'panel' => 'bizstrait_footer_setting', // 'priority' => 2, ) ); $wp_customize->add_setting( 'copyright_display', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'bizstrait_switch_sanitization', ) ); $wp_customize->add_control( new Bizstrait_Toggle_Switch_Custom_Control( $wp_customize, 'copyright_display', array( 'label' => __( 'Display', 'bizstrait' ), 'section' => 'bizstrait_footer_bar', ) ) ); $wp_customize->add_setting( 'copyright_text', array( /* translators: 1: theme name, 2: theme url. */ 'default' => sprintf( esc_html__( 'Theme: %1$s by %2$s', 'bizstrait' ), 'Bizstrait', 'Unibird Tech' ), 'transport' => 'refresh', 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( 'copyright_text', array( 'label' => __( 'Copyright Text', 'bizstrait' ), 'section' => 'bizstrait_footer_bar', 'type' => 'textarea', ) ); /** * copyright_text */ $wp_customize->selective_refresh->add_partial( 'copyright_text', array( 'selector' => 'footer div.col-md-6.copyright-text', 'settings' => 'copyright_text', 'render_callback' => function () { return get_theme_mod( 'copyright_text' ); }, ) ); /** * Policy */ $wp_customize->add_setting( 'footer_privacy_policy', array( 'default' => esc_html('Privacy Policy.', 'bizstrait'), 'transport' => 'refresh', 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new Bizstrait_Toggle_Switch_Custom_Control( $wp_customize, 'footer_privacy_policy', array( 'label' => __( 'Display', 'bizstrait' ), 'section' => 'bizstrait_footer_bar', ) ) ); $wp_customize->add_setting( 'footer_privacy_policy_url', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'footer_privacy_policy_url', array( 'type' => 'url', 'section' => 'bizstrait_footer_bar', // Add a default or your own section 'label' => __( 'Privacy policy URL', 'bizstrait' ), // 'description' => __( 'This is a custom url input.' ), 'input_attrs' => array( 'placeholder' => __( 'https://yourPrivacyUrl/', 'bizstrait' ), ), ) ); $wp_customize->add_setting( 'footer_privacy_policy_txt', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', 'default'=> __( 'Privacy Policy.', 'bizstrait' ), ) ); $wp_customize->add_control( 'footer_privacy_policy_txt', array( 'type' => 'url', 'section' => 'bizstrait_footer_bar', // Add a default or your own section 'label' => __( 'Privacy policy text', 'bizstrait' ), // 'description' => __( 'This is a custom url input.' ), 'input_attrs' => array( 'placeholder' => __( 'Privacy Policy.' , 'bizstrait' ), ), ) ); /** * menu_inline_btn_text */ $wp_customize->selective_refresh->add_partial( 'menu_inline_btn_text', array( 'selector' => 'header a.btn.btn-default.quote_btn', 'settings' => 'menu_inline_btn_text', 'render_callback' => function () { return get_theme_mod( 'menu_inline_btn_text' ); }, ) ); /** * topbar_search_icon_display */ $wp_customize->selective_refresh->add_partial( 'topbar_search_icon_display', array( 'selector' => 'header a.\#', 'settings' => 'topbar_search_icon_display', 'render_callback' => function () { return get_theme_mod( 'topbar_search_icon_display' ); }, ) ); } add_action( 'customize_register', 'bizstrait_footer_customizer_setting' );