get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; /** * Load custom customizer control for radio image control */ require get_template_directory() . '/inc/customizer/controls/class-customizer-radio-image-control.php'; /** * Load custom customizer control for toggle control */ require get_template_directory() . '/inc/customizer/controls/class-customizer-toggle-control.php'; /** * Load customizer functions for sanitization of input values of contol fields */ require get_template_directory() . '/inc/customizer/functions/sanitize-callback.php'; /** * Load customizer functions for loading control field's choices, declaration of panel, section * and control fields */ require get_template_directory() . '/inc/customizer/functions/customizer-fields.php'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'alpha_blog_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'alpha_blog_customize_partial_blogdescription', ) ); } /** * Control Rearrange */ $wp_customize->get_control( 'header_textcolor' )->label = esc_html__( 'Site Title Color', 'alpha-blog' ); $wp_customize->get_control( 'background_color' )->section = 'background_image'; $wp_customize->get_section( 'background_image' )->title = esc_html__( 'Site Background', 'alpha-blog' ); $wp_customize->get_control( 'header_image' )->priority = 30; $wp_customize->get_control( 'custom_logo' )->section = 'alpha_blog_site_logo_section'; $wp_customize->get_control( 'blogname' )->section = 'alpha_blog_site_logo_section'; $wp_customize->get_control( 'blogdescription' )->section = 'alpha_blog_site_logo_section'; $wp_customize->get_control( 'header_textcolor' )->section = 'alpha_blog_site_logo_section'; $wp_customize->get_control( 'display_header_text' )->section = 'alpha_blog_site_logo_section'; $wp_customize->get_control( 'site_icon' )->section = 'alpha_blog_site_favicon_section'; $wp_customize->get_control( 'header_image' )->section = 'alpha_blog_main_header_section'; } add_action( 'customize_register', 'alpha_blog_customize_register' ); /** * Load active callback functions. */ require get_template_directory() . '/inc/customizer/functions/active-callback.php'; /** * Load option choices functions. */ require get_template_directory() . '/inc/customizer/functions/option-choices.php'; /** * Render the site title for the selective refresh partial. * * @return void */ function alpha_blog_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function alpha_blog_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Function to load dynamic styles. * * @since 1.0.0 * @access public * @return null */ function dynamic_style() { ?> get( 'Version' ) , true ); // Localize the script with new data $title_array = array( 'custom_logo' => esc_html__( 'Logo Setup', 'alpha-blog' ), 'site_icon' => esc_html__( 'Favicon', 'alpha-blog' ), 'background_color' => esc_html__( 'Body Background', 'alpha-blog' ), 'header_image' => esc_html__( 'Header Image', 'alpha-blog' ), 'alpha_blog_header_display_social_links' => esc_html__( 'Header Menu', 'alpha-blog' ), 'alpha_blog_site_banner_post_category' => esc_html__( 'Banner Content', 'alpha-blog' ), 'alpha_blog_site_pages_blog_page_display_post_featured_image' => esc_html__( 'Post Content', 'alpha-blog' ), 'alpha_blog_site_pages_blog_page_sidebar_position' => esc_html__( 'Sidebar Position', 'alpha-blog' ), 'alpha_blog_site_pages_archive_page_display_post_featured_image' => esc_html__( 'Post Content', 'alpha-blog' ), 'alpha_blog_site_pages_archive_page_sidebar_position' => esc_html__( 'Sidebar Position', 'alpha-blog' ), 'alpha_blog_site_pages_search_page_display_post_featured_image' => esc_html__( 'Post Content', 'alpha-blog' ), 'alpha_blog_site_pages_search_page_sidebar_position' => esc_html__( 'Sidebar Position', 'alpha-blog' ), 'alpha_blog_site_pages_post_single_display_post_featured_image' => esc_html__( 'Post Content', 'alpha-blog' ), 'alpha_blog_site_pages_post_single_display_post_author_section' => esc_html__( 'Author Section', 'alpha-blog' ), 'alpha_blog_site_pages_post_single_display_related_posts_section' => esc_html__( 'Related Posts Section', 'alpha-blog' ), 'alpha_blog_site_footer_upload_footer_logo' => esc_html__( 'Upload Logo', 'alpha-blog' ), ); wp_localize_script( 'alpha-blog-customizer-script', 'alpha_blog', $title_array ); // Enqueued script with localized data. wp_enqueue_script( 'alpha-blog-customizer-script' ); } add_action( 'customize_controls_enqueue_scripts', 'alpha_blog_enqueues' );