selective_refresh ) ? 'postMessage' : 'refresh'; // Footer Panel // $wp_customize->add_panel( 'automotive_services_footer_section', array( 'priority' => 34, 'capability' => 'edit_theme_options', 'title' => __('Footer', 'automotive-services'), ) ); // Footer Widgets // $wp_customize->add_section( 'footer_top', array( 'title' => __('Footer Widgets','automotive-services'), 'panel' => 'automotive_services_footer_section', 'priority' => 3, ) ); // Footer Widgets Hide/ Show Setting // $wp_customize->add_setting( 'footer_widgets_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'footer_widgets_setting', array( 'label' => esc_html__( 'Hide / Show Footer Widgets', 'automotive-services' ), 'section' => 'footer_top', 'settings' => 'footer_widgets_setting', 'type' => 'checkbox' ) ); // Footer Bottom // $wp_customize->add_section( 'automotive_services_footer_bottom', array( 'title' => __('Footer Bottom','automotive-services'), 'panel' => 'automotive_services_footer_section', 'priority' => 3, ) ); // Footer Copyright Head $wp_customize->add_setting( 'automotive_services_footer_btm_copy_head' ,array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'automotive_services_sanitize_text', 'priority' => 3, ) ); // Site Title Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_footer_copyright_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'automotive_services_footer_copyright_setting', array( 'label' => esc_html__( 'Hide / Show Footer Copyright', 'automotive-services' ), 'section' => 'automotive_services_footer_bottom', 'settings' => 'automotive_services_footer_copyright_setting', 'type' => 'checkbox' ) ); // Footer Copyright $wp_customize->add_setting( 'automotive_services_footer_copyright', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 4, ) ); $wp_customize->add_control( 'automotive_services_footer_copyright', array( 'label' => __('Copyright','automotive-services'), 'section' => 'automotive_services_footer_bottom', 'type' => 'text', 'transport' => $selective_refresh, ) ); $wp_customize->add_setting( 'automotive_services_copyright_alignment', array( 'default' => 'center', 'sanitize_callback' => 'automotive_services_sanitize_copyright_position', )); $wp_customize->add_control( 'automotive_services_copyright_alignment', array( 'label' => __( 'Copyright Position', 'automotive-services' ), 'section' => 'automotive_services_footer_bottom', 'settings' => 'automotive_services_copyright_alignment', 'type' => 'radio', 'choices' => array( 'right' => __( 'Right Align', 'automotive-services' ), 'left' => __( 'Left Align', 'automotive-services' ), 'center' => __( 'Center Align', 'automotive-services' ), ), )); } add_action( 'customize_register', 'automotive_services_footer' ); // Footer selective refresh function automotive_services_footer_partials( $wp_customize ){ // footer_copyright $wp_customize->selective_refresh->add_partial( 'footer_copyright', array( 'selector' => '.copy-right .copyright-text', 'settings' => 'footer_copyright', 'render_callback' => 'automotive_services_footer_copyright_render_callback', ) ); } add_action( 'customize_register', 'automotive_services_footer_partials' ); // copyright_content function automotive_services_footer_copyright_render_callback() { return get_theme_mod( 'footer_copyright' ); }