get_setting('blogname')->transport = 'postMessage'; $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; $wp_customize->get_setting('header_textcolor')->transport = 'postMessage'; $widgets_section = (object)$wp_customize->get_panel('widgets'); $widgets_section->title = esc_html__('Widgets','avenews'); $widgets_section->priority = 155; if (isset($wp_customize->selective_refresh)) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'avenews_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'avenews_customize_partial_blogdescription', ) ); } /*Get default values to set while building customizer elements*/ $default_options = avenews_get_default_customizer_values(); /* Header Background Color*/ $wp_customize->add_setting( 'avenews_options[header_bg_color]', array( 'default' => $default_options['header_bg_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'avenews_options[header_bg_color]', array( 'label' => __('Header Background Color', 'avenews'), 'section' => 'colors', 'type' => 'color', 'priority' => 1, ) ) ); /*Load customizer options.*/ require_once get_template_directory() . '/inc/customizer/theme-options/page-loading-add.php'; require_once get_template_directory() . '/inc/customizer/theme-options/preloader.php'; require_once get_template_directory() . '/inc/customizer/theme-options/night-mode.php'; require_once get_template_directory() . '/inc/customizer/theme-options/topbar.php'; require_once get_template_directory() . '/inc/customizer/theme-options/header.php'; require_once get_template_directory() . '/inc/customizer/theme-options/top-tagged.php'; require_once get_template_directory() . '/inc/customizer/theme-options/ticker-bar.php'; require_once get_template_directory() . '/inc/customizer/theme-options/front-page-banner.php'; require_once get_template_directory() . '/inc/customizer/theme-options/front-page-jumbotron.php'; require_once get_template_directory() . '/inc/customizer/theme-options/three-col-banner-section.php'; require_once get_template_directory() . '/inc/customizer/theme-options/read-more.php'; require_once get_template_directory() . '/inc/customizer/theme-options/front-page.php'; require_once get_template_directory() . '/inc/customizer/theme-options/general-setting.php'; require_once get_template_directory() . '/inc/customizer/theme-options/archive.php'; require_once get_template_directory() . '/inc/customizer/theme-options/single.php'; require_once get_template_directory() . '/inc/customizer/theme-options/pagination.php'; require_once get_template_directory() . '/inc/customizer/theme-options/social-share.php'; require_once get_template_directory() . '/inc/customizer/theme-options/footer-recommended.php'; require_once get_template_directory() . '/inc/customizer/theme-options/footer.php'; require_once get_template_directory() . '/inc/customizer/theme-options/theme-options.php'; if (class_exists('WooCommerce')) { require_once get_template_directory() . '/inc/customizer/theme-options/shop.php'; } // View Pro $wp_customize->add_section('pro__section', array( 'title' => '' . esc_html__('View PRO Version', 'avenews'), 'priority' => 2, 'description' => sprintf( /* translators: %s: The view pro link. */ __('

Need More? Go PRO

Take it to the next level. See the features below:

%s
', 'avenews'), /* translators: %1$s: The view pro URL, %2$s: The view pro link text. */ sprintf('%2$s', esc_url(avenews_get_pro_link()), esc_html__('View Avenews PRO', 'avenews')) ), )); $wp_customize->add_setting('avenews_style_view_pro_desc', array( 'default' => '', 'sanitize_callback' => '__return_true', )); $wp_customize->add_control('avenews_style_view_pro_desc', array( 'section' => 'pro__section', 'type' => 'hidden', )); } add_action('customize_register', 'avenews_customize_register'); /** * Render the site title for the selective refresh partial. * * @return void */ function avenews_customize_partial_blogname() { bloginfo('name'); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function avenews_customize_partial_blogdescription() { bloginfo('description'); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function avenews_customize_preview_js() { wp_enqueue_script('avenews-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array('customize-preview'), AVENEWS_S_VERSION, true); } add_action('customize_preview_init', 'avenews_customize_preview_js'); /** * Customizer control scripts and styles. * * @since 1.0.0 */ function avenews_customizer_control_scripts() { wp_enqueue_style('avenews-customizer-css', get_template_directory_uri() . '/assets/css/customizer.css'); wp_enqueue_script('avenews-customizer-controls', get_template_directory_uri() . '/assets/js/customizer-admin.js', array('jquery', 'jquery-ui-sortable', 'customize-controls')); } add_action('customize_controls_enqueue_scripts', 'avenews_customizer_control_scripts', 0); /** * Generate a link to the premium theme info page. */ function avenews_get_pro_link() { return 'https://www.themeinwp.com/theme/avenews-pro/'; }