register_control_type( Nilambar\CustomizerUtils\Control\DropdownTaxonomies::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\Image::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\Number::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\Radio::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\Select::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\Sortable::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\Switcher::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\Text::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\Textarea::class ); $wp_customize->register_control_type( Nilambar\CustomizerUtils\Control\URL::class ); $wp_customize->register_section_type( Button::class ); $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' => 'nari_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'nari_customize_partial_blogdescription', ) ); } $wp_customize->add_section( new Button( $wp_customize, 'nari_upgrade_button', array( 'title' => esc_html__( 'Nari Pro', 'nari' ), 'priority' => 1, 'button' => array( 'text' => esc_html__( 'Upgrade to Pro', 'nari' ), 'url' => 'https://wphait.com/themes/nari/', ), ) ) ); // Load options. require_once trailingslashit( get_template_directory() ) . '/inc/customizer/options/options.php'; } add_action( 'customize_register', 'nari_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function nari_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function nari_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function nari_customize_preview_js() { wp_enqueue_script( 'nari-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), NARI_VERSION, true ); } add_action( 'customize_preview_init', 'nari_customize_preview_js' );