add_section( 'alley_themes_customize_cta_block_options_section', array( 'title' => esc_html__( 'Cta Blocks', 'alley-themes' ), 'priority' => 13, ) ); $wp_customize->add_setting( 'heading_cta_block_1', array( 'default' => '', 'type' => 'customtext', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Alley_Themes_Custom_Text( $wp_customize, 'heading_cta_block_1', array( 'label' => esc_html__( 'Cta block 1 :', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'heading_cta_block_1' ) ) ); $wp_customize->selective_refresh->add_partial('title_for_cta_block_1', array( 'selector' => '.banner-blocks .block-holder .title ', // You can also select a css class )); $wp_customize->add_setting( 'cta_block_1_show_hide', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'cta_block_1_show_hide', array( 'label' => esc_html__( 'Hide / Show Cta Block 1','alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_1_show_hide', 'type'=> 'toggle', ) ) ); $wp_customize->add_setting('cta_block_1_image', array( 'transport' => 'refresh', 'sanitize_callback' => 'alley_themes_sanitize_file', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cta_block_1_image', array( 'label' => __('Image', 'alley-themes'), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_1_image', 'active_callback' => function(){ return get_theme_mod( 'cta_block_1_show_hide', true ); }, ))); $wp_customize->add_setting( 'title_for_cta_block_1', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'title_for_cta_block_1', array( 'label' => esc_html__( 'Title', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'title_for_cta_block_1', 'type'=> 'text', 'active_callback' => function(){ return get_theme_mod( 'cta_block_1_show_hide', true ); }, ) ); $wp_customize->add_setting( 'content_for_cta_block_1', array( 'sanitize_callback' => 'sanitize_textarea_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'content_for_cta_block_1', array( 'label' => esc_html__( 'Description', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'content_for_cta_block_1', 'type'=> 'textarea', 'active_callback' => function(){ return get_theme_mod( 'cta_block_1_show_hide', true ); }, ) ); $wp_customize->add_setting( 'cta_block_1_link_label', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'cta_block_1_link_label', array( 'label' => esc_html__( 'Link Button', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_1_link_label', 'type'=> 'text', 'active_callback' => function(){ return get_theme_mod( 'cta_block_1_show_hide', true ); }, ) ); $wp_customize->add_setting( 'cta_block_1_link', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'cta_block_1_link', array( 'label' => esc_html__( 'Link', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_1_link', 'type'=> 'url', 'active_callback' => function(){ return get_theme_mod( 'cta_block_1_show_hide', true ); }, ) ); $wp_customize->add_setting( 'heading_cta_block_2', array( 'default' => '', 'type' => 'customtext', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Alley_Themes_Custom_Text( $wp_customize, 'heading_cta_block_2', array( 'label' => esc_html__( 'Cta block 2 :', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'heading_cta_block_2' ) ) ); $wp_customize->add_setting( 'cta_block_2_show_hide', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'cta_block_2_show_hide', array( 'label' => esc_html__( 'Hide / Show Cta Block 2','alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_2_show_hide', 'type'=> 'toggle', ) ) ); $wp_customize->add_setting('cta_block_2_image', array( 'transport' => 'refresh', 'sanitize_callback' => 'alley_themes_sanitize_file', 'height' => '', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cta_block_2_image', array( 'label' => __('Image', 'alley-themes'), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_2_image', 'active_callback' => function(){ return get_theme_mod( 'cta_block_2_show_hide', true ); }, ))); $wp_customize->add_setting( 'title_for_cta_block_2', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'title_for_cta_block_2', array( 'label' => esc_html__( 'Title', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'title_for_cta_block_2', 'type'=> 'text', 'active_callback' => function(){ return get_theme_mod( 'cta_block_2_show_hide', true ); }, ) ); $wp_customize->add_setting( 'content_for_cta_block_2', array( 'sanitize_callback' => 'sanitize_textarea_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'content_for_cta_block_2', array( 'label' => esc_html__( 'Description', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'content_for_cta_block_2', 'type'=> 'textarea', 'active_callback' => function(){ return get_theme_mod( 'cta_block_2_show_hide', true ); }, ) ); $wp_customize->add_setting( 'cta_block_2_link_label', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'cta_block_2_link_label', array( 'label' => esc_html__( 'Link Button', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_2_link_label', 'type'=> 'text', 'active_callback' => function(){ return get_theme_mod( 'cta_block_2_show_hide', true ); }, ) ); $wp_customize->add_setting( 'cta_block_2_link', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'cta_block_2_link', array( 'label' => esc_html__( 'Link', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_2_link', 'type'=> 'url', 'active_callback' => function(){ return get_theme_mod( 'cta_block_2_show_hide', true ); }, ) ); $wp_customize->add_setting( 'heading_cta_block_3', array( 'default' => '', 'type' => 'customtext', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Alley_Themes_Custom_Text( $wp_customize, 'heading_cta_block_3', array( 'label' => esc_html__( 'Cta block 3 :', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'heading_cta_block_3' ) ) ); $wp_customize->add_setting( 'cta_block_3_show_hide', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'cta_block_3_show_hide', array( 'label' => esc_html__( 'Hide / Show Cta Block 3','alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_3_show_hide', 'type'=> 'toggle', ) ) ); $wp_customize->add_setting('cta_block_3_image', array( 'transport' => 'refresh', 'sanitize_callback' => 'alley_themes_sanitize_file', 'height' => '', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cta_block_3_image', array( 'label' => __('Image', 'alley-themes'), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_3_image', 'active_callback' => function(){ return get_theme_mod( 'cta_block_3_show_hide', true ); }, ))); $wp_customize->add_setting( 'title_for_cta_block_3', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'title_for_cta_block_3', array( 'label' => esc_html__( 'Title', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'title_for_cta_block_3', 'type'=> 'text', 'active_callback' => function(){ return get_theme_mod( 'cta_block_3_show_hide', true ); }, ) ); $wp_customize->add_setting( 'content_for_cta_block_3', array( 'sanitize_callback' => 'sanitize_textarea_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'content_for_cta_block_3', array( 'label' => esc_html__( 'Description', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'content_for_cta_block_3', 'type'=> 'textarea', 'active_callback' => function(){ return get_theme_mod( 'cta_block_3_show_hide', true ); }, ) ); $wp_customize->add_setting( 'cta_block_3_link_label', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'cta_block_3_link_label', array( 'label' => esc_html__( 'Link Button', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_3_link_label', 'type'=> 'text', 'active_callback' => function(){ return get_theme_mod( 'cta_block_3_show_hide', true ); }, ) ); $wp_customize->add_setting( 'cta_block_3_link', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'cta_block_3_link', array( 'label' => esc_html__( 'Link', 'alley-themes' ), 'section' => 'alley_themes_customize_cta_block_options_section', 'settings' => 'cta_block_3_link', 'type'=> 'url', 'active_callback' => function(){ return get_theme_mod( 'cta_block_3_show_hide', true ); }, ) ); }