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' => 'adri_customize_partial_blogname',
) );
$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
'selector' => '.site-description',
'render_callback' => 'adri_customize_partial_blogdescription',
) );
}
// View PRO Version
$wp_customize->add_section( 'adri_style_view_pro', array(
'title' => '' . esc_html__( 'Upgrage to Pro', 'adri' ),
'priority' => 2,
'description' => sprintf(
//unintrosive upsell message
__( '
Upgrade to PRO Today!
Get the pro add-on plugin today:
-
Portfolio Plugin
Have a dedicated portfolio post types with an image library, category filtering and styled portfolio page.
-
Galleries & Albums
Upload galleries/Albums in your portfolios with a single click
-
Video Support
Upload videos from youtube or vimeo
-
One On One Email Support
Get one on one email support from our experienced support stuff, we can also help you modify the theme to your liking
%s
', 'adri' ),
sprintf( '%2$s', esc_url( adri_get_pro_link() ), esc_html__( 'Upgrade To PRO', 'adri' ) )
),
) );
$wp_customize->add_setting( 'adri_pro_desc', array(
'default' => '',
'sanitize_callback' => 'adri_sanitize_checkbox',
) );
$wp_customize->add_control( 'adri_pro_desc', array(
'section' => 'adri_style_view_pro',
'type' => 'hidden',
) );
$wp_customize->add_setting( 'link_color' , array(
'default' => '#e74c3c',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_control(new WP_Customize_Color_Control( $wp_customize,'link_color',
array(
'label' => esc_html__( 'Link Color', 'adri' ),
'section' => 'colors',
'settings' => 'link_color',
) )
);
}
add_action( 'customize_register', 'adri_customize_register' );
/**
* Render the site title for the selective refresh partial.
*
* @return void
*/
function adri_customize_partial_blogname() {
bloginfo( 'name' );
}
/**
* Render the site tagline for the selective refresh partial.
*
* @return void
*/
function adri_customize_partial_blogdescription() {
bloginfo( 'description' );
}
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function adri_customize_preview_js() {
wp_enqueue_script( 'adri-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true );
}
add_action( 'customize_preview_init', 'adri_customize_preview_js' );
/**
* Admin CSS
*/
function adri_customizer_assets() {
wp_enqueue_style( 'adri_customizer_style', get_template_directory_uri() . '/css/upsell.css', null, '1.0.0', false );
}
add_action( 'customize_controls_enqueue_scripts', 'adri_customizer_assets' );
/**
* Generate a link to the Noah Lite info page.
*/
function adri_get_pro_link() {
return 'https://aperturewp.com/downloads/adri/';
}