selective_refresh ) ? 'postMessage' : 'refresh'; // Footer Panel // $wp_customize->add_panel( 'footer_section', array( 'priority' => 160, 'capability' => 'edit_theme_options', 'title' => __('Footer', 'aqwa'), ) ); // Footer widget column // $wp_customize->add_section('footer_layout', array( 'title' => __('Footer Layout','aqwa'), 'panel' => 'footer_section', 'priority' => 2, ) ); $wp_customize->add_setting('aqwa_footer_widget_column', array( 'default' => 'col-lg-3', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_radio'), 'priority' => 1, ) ); $wp_customize->add_control( 'aqwa_footer_widget_column', array( 'type' => 'radio', 'section' => 'footer_layout', 'label' => __( 'Footer Widget Column', 'aqwa' ), 'description' => __( 'Change the footer widget column','aqwa' ), 'choices' => array( 'col-lg-6' => __( 'Two Column','aqwa' ), 'col-lg-4' => __( 'Three Column' ,'aqwa' ), 'col-lg-3' => __( 'Four Column' ,'aqwa' ), ), ) ); // Footer bar // $wp_customize->add_section( 'footer_bar_bottom', array( 'title' => __('Footer Bar','aqwa'), 'panel' => 'footer_section', 'priority' => 3, ) ); // Footer Copyright $copy_text = esc_html__('Copyright © [year] | By [author]', 'aqwa' ); $wp_customize->add_setting( 'aqwa_footer_copyright', array( 'default' => $copy_text, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 4, ) ); $wp_customize->add_control( 'aqwa_footer_copyright', array( 'label' => __('Copyright','aqwa'), 'description' => __('[year] => Current year
[author] => Theme author','aqwa'), 'section' => 'footer_bar_bottom', 'type' => 'textarea', 'transport' => $selective_refresh, ) ); } public function add_partials( $wp_customize ){ $wp_customize->selective_refresh->add_partial( 'aqwa_footer_copyright', array( 'selector' => '.footer-coppy-right p', 'render_callback' => function() { return get_theme_mod( 'aqwa_footer_copyright' ); }, ) ); } public function sanitize_radio( $input, $setting ) { // Ensure input is a slug. $input = sanitize_key( $input ); // Get list of choices from the control associated with the setting. $choices = $setting->manager->get_control( $setting->id )->choices; // If the input is a valid key, return it; otherwise, return the default. return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } } new Aqwa_Footer_Customize(); }