title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; return $array; } } } /* * Customize Section */ if ( class_exists( 'WP_Customize_Section' ) ) { class Beauty_Lab_Customize_Section extends WP_Customize_Section { public $section; public $type = 'pe_section'; public function json() { $array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'panel', 'type', 'description_hidden', 'section', ) ); $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; if ( $this->panel ) { $array['customizeAction'] = sprintf( 'Customizing ▸ %s', esc_html( $this->manager->get_panel( $this->panel )->title ) ); } else { $array['customizeAction'] = 'Customizing'; } return $array; } } } /** * Add postMessage support for site title and description for the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ function beauty_lab_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'beauty_lab_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'beauty_lab_customize_partial_blogdescription', ) ); } // register panel and section type $wp_customize->register_panel_type( 'Beauty_Lab_Customize_Panel' ); $wp_customize->register_section_type( 'Beauty_Lab_Customize_Section' ); //---remove header image control---- $wp_customize->remove_section('header_image'); //------blog panel--------- $blog_panel = new Beauty_Lab_Customize_Panel( $wp_customize, 'beauty_lab_blog', array( 'title' => __( 'Blog', 'beauty-lab' ), 'priority' => 105, )); $wp_customize->add_panel( $blog_panel ); //------Header panel--------- $header_panel = new Beauty_Lab_Customize_Panel( $wp_customize, 'beauty_lab_header', array( 'title' => __( 'Header', 'beauty-lab' ), 'priority' => 24, )); $wp_customize->add_panel( $header_panel ); //--global panel---- $global_panel = new Beauty_Lab_Customize_Panel( $wp_customize, 'global_panel', array( 'title' => __( 'Global', 'beauty-lab' ), 'priority' => 10, )); $wp_customize->add_panel( $global_panel ); //--register typography panel---- $typography_panel = new Beauty_Lab_Customize_Panel( $wp_customize, 'beauty_lab_typography', array( 'title' => __( 'Typography', 'beauty-lab' ), 'panel' => 'global_panel', )); $wp_customize->add_panel( $typography_panel ); //----background section----- $wp_customize->add_section('background_image', array( 'title' => __('Background Image', 'beauty-lab'), 'panel' => 'global_panel', 'priority' => 3, )); //------blog single panel--------- $blog_single_panel = new Beauty_Lab_Customize_Panel( $wp_customize, 'beauty_lab_blog_single', array( 'title' => __( 'Blog Single', 'beauty-lab' ), 'panel' => 'beauty_lab_blog', 'priority' => 10, )); $wp_customize->add_panel( $blog_single_panel ); //------blog single heading typography panel--------- $blog_single_heading_typo = new Beauty_Lab_Customize_Panel( $wp_customize, 'beauty_lab_blog_single_heading_typo', array( 'title' => __( 'Heading Typography', 'beauty-lab' ), 'panel' => 'beauty_lab_blog_single', 'priority' => 1, )); $wp_customize->add_panel( $blog_single_heading_typo ); } add_action( 'customize_register', 'beauty_lab_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function beauty_lab_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function beauty_lab_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function beauty_lab_customize_preview_js() { wp_enqueue_script( 'beauty-lab-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), _S_VERSION, true ); } add_action( 'customize_preview_init', 'beauty_lab_customize_preview_js' ); /** * Enqueue customize controls scripts. */ function beauty_lab_customizer_controls_scripts() { wp_enqueue_script( 'customizer-control', get_template_directory_uri() . '/assets/js/customize-controls.js', array(), '2.3.4', true ); } add_action( 'customize_controls_enqueue_scripts', 'beauty_lab_customizer_controls_scripts' ); /** * Customizer Controls required files. */ require get_template_directory() . '/inc/customizer/customizer-select-options.php'; require get_template_directory() . '/inc/customizer/customizer-sanitization.php'; require get_template_directory() . '/inc/customizer/customizer-separator.php'; require get_template_directory() . '/inc/customizer/customizer-header.php'; require get_template_directory() . '/inc/customizer/customizer-breadcrumb.php'; require get_template_directory() . '/inc/customizer/customizer-color-option.php'; require get_template_directory() . '/inc/customizer/customizer-container.php'; require get_template_directory() . '/inc/customizer/customizer-body-typography.php'; require get_template_directory() . '/inc/customizer/customizer-blog-global.php'; require get_template_directory() . '/inc/customizer/customizer-blog-list.php'; require get_template_directory() . '/inc/customizer/customizer-blog-single-title-typo.php'; require get_template_directory() . '/inc/customizer/customizer-blog-single-content.php'; require get_template_directory() . '/inc/customizer/customizer-footer-option.php'; require get_template_directory() . '/inc/customizer/customizer-typography-h1.php'; require get_template_directory() . '/inc/customizer/customizer-typography-h2.php'; require get_template_directory() . '/inc/customizer/customizer-typography-h3.php'; require get_template_directory() . '/inc/customizer/customizer-typography-h4.php'; require get_template_directory() . '/inc/customizer/customizer-typography-h5.php'; require get_template_directory() . '/inc/customizer/customizer-typography-h6.php'; require get_template_directory() . '/inc/customizer/customizer-scroll2top.php'; require get_template_directory() . '/inc/customizer/customizer-blog-single-typo-h1.php'; require get_template_directory() . '/inc/customizer/customizer-blog-single-typo-h2.php'; require get_template_directory() . '/inc/customizer/customizer-blog-single-typo-h3.php'; require get_template_directory() . '/inc/customizer/customizer-blog-single-typo-h4.php'; require get_template_directory() . '/inc/customizer/customizer-blog-single-typo-h5.php'; require get_template_directory() . '/inc/customizer/customizer-blog-single-typo-h6.php'; require get_template_directory() . '/inc/customizer/customizer-woocommerce.php';