selective_refresh ) ) { return; } $selective_refresh_keys = array( // section services array( 'id' => 'service', 'selector' => '.service-area .container', 'settings' => array( 'book_land_option[book_land_servicetitle]', 'book_land_option[book_land_servicesubtitle]', 'book_land_option[book_land_services]', ), ), // section about array( 'id' => 'about', 'selector' => '.about-area .container', 'settings' => array( 'book_land_option[book_land_abouttitle]', 'book_land_option[book_land_aboutsubtitle]', 'book_land_option[book_land_about_boxes]', ), ), // section counter array( 'id' => 'counter', 'selector' => '.skill-area .container', 'settings' => array( 'book_land_option[book_land_countertitle]', 'book_land_option[book_land_countersubtitle]', 'book_land_option[book_land_counters]', ), ), // section team array( 'id' => 'team', 'selector' => '.team-area .container', 'settings' => array( 'book_land_option[book_land_teamtitle]', 'book_land_option[book_land_teamsubtitle]', 'book_land_option[book_land_team]', ), ), // section testimonial array( 'id' => 'testimonial', 'selector' => '.testimonial-area .container', 'settings' => array( 'book_land_option[book_land_teamtitle]', 'book_land_option[book_land_teamsubtitle]', 'book_land_option[book_land_team]', ), ), // section video array( 'id' => 'video', 'selector' => '.video-area .container', 'settings' => array( 'book_land_option[book_land_videotitle]', 'book_land_option[book_land_video_link]', ), ), // section pricing array( 'id' => 'pricing', 'selector' => '.pricing-area .container', 'settings' => array( 'book_land_option[book_land_pricingtitle]', 'book_land_option[book_land_pricingsubtitle]', 'book_land_option[book_land_pricingitems]', ), ), // section callout array( 'id' => 'callout', 'selector' => '.callout-area .container', 'settings' => array( 'book_land_option[book_land_callouttitle]', 'book_land_option[book_land_button_text]', 'book_land_option[book_land_button_url]', ), ), // section project array( 'id' => 'project', 'selector' => '.portfolio-area .container', 'settings' => array( 'book_land_option[book_land_projecttitle]', 'book_land_option[book_land_projectsubtitle]', ), ), // section contact array( 'id' => 'contact', 'selector' => '.contact-area .container', 'settings' => array( 'book_land_option[book_land_contacttitle]', 'book_land_option[book_land_contactsubtitle]', ), ), // section blog array( 'id' => 'blog', 'selector' => '.news-area .container', 'settings' => array( 'book_land_option[book_land_blogtitle]', 'book_land_option[book_land_blogsubtitle]', ), ), // section newsletter array( 'id' => 'newsletter', 'selector' => '.newsletter-area .container', 'settings' => array( 'book_land_option[book_land_newslettertitle]', 'book_land_option[book_land_newsletter_link]', ), ), // section social array( 'id' => 'social', 'selector' => '.social-area .container', 'settings' => array( 'book_land_option[book_land_socialtitle]', 'book_land_option[book_land_socialsubtitle]', ), ), // section client array( 'id' => 'client', 'selector' => '.client-area .container', 'settings' => array( 'book_land_option[book_land_clienttitle]', 'book_land_option[book_land_clientsubtitle]', 'book_land_option[book_land_client]', ), ), ); foreach ( $selective_refresh_keys as $section ) { foreach ( $section['settings'] as $key ) { if ( $wp_customize->get_setting( $key ) ) { $wp_customize->get_setting( $key )->transport = 'postMessage'; } } $wp_customize->selective_refresh->add_partial( 'section-'.$section['id'] , array( 'selector' => $section['selector'], 'settings' => $section['settings'], 'render_callback' => 'book_land_selective_refresh_render_section_content', )); } $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->selective_refresh->add_partial( 'blogname' , array( 'selector' => '.site-title span', 'settings' => array('blogname'), 'render_callback' => 'hotelparadise_blogname', )); $wp_customize->selective_refresh->add_partial( 'blogdescription' , array( 'selector' => '.site-description', 'settings' => array('blogdescription'), 'render_callback' => 'hotelparadise_blogdescription', )); } add_action( 'customize_register', 'book_land_customizer_partials', 199 ); function book_land_selective_refresh_render_section_content( $partial, $container_context = array() ) { $tpl = 'home-page/'.$partial->id.'.php'; $GLOBALS['book_land_is_selective_refresh'] = true; $file = book_land_customizer_load_template( $tpl ); if ( $file ) { include $file; } } function book_land_blogname(){ bloginfo('name'); } function book_land_blogdescription(){ bloginfo('decription'); }