<?php
/**
 * Theme Ostrich Customizer
 *
 * @package Return Blog
 *
 * cta section
 */
$wp_customize->add_section(
	'return_blog_cta',
	array(
		'title' => esc_html__( 'Cta', 'return-blog' ),
		'panel' => 'return_blog_home_panel',
	)
);


// blog enable settings
$wp_customize->add_setting(
	'return_blog_cta',
	array(
		'sanitize_callback' => 'return_blog_sanitize_select',
		'default' => 'disable',
	)
);
$wp_customize->add_control(
	'return_blog_cta',
	array(
		'section'		=> 'return_blog_cta',
		'label'			=> esc_html__( 'Content type:', 'return-blog' ),
		'description'			=> esc_html__( 'Choose where you want to render the content from.', 'return-blog' ),
		'type'			=> 'select',
		'choices'		=> array(
				'disable' => esc_html__( '--Disable--', 'return-blog' ),
				'page' => esc_html__( 'Page', 'return-blog' ),
		 	)
	)
);

for ($i=1; $i <= 1 ; $i++) {
	// blog post setting
	$wp_customize->add_setting(
		'return_blog_cta_post_'.$i,
		array(
			'sanitize_callback' => 'return_blog_sanitize_dropdown_pages',
		)
	);
	$wp_customize->add_control(
		'return_blog_cta_post_'.$i,
		array(
			'section'		=> 'return_blog_cta',
			'label'			=> esc_html__( 'Post ', 'return-blog' ).$i,
			'active_callback' => 'return_blog_if_cta_post',
			'type'			=> 'select',
			'choices'		=> return_blog_get_post_choices(),
		)
	);
	// blog page setting
	$wp_customize->add_setting(
		'return_blog_cta_page_'.$i,
		array(
			'sanitize_callback' => 'return_blog_sanitize_dropdown_pages',
			'default' => 0,
		)
	);
	$wp_customize->add_control(
		'return_blog_cta_page_'.$i,
		array(
			'section'		=> 'return_blog_cta',
			'label'			=> esc_html__( 'Page ', 'return-blog' ).$i,
			'type'			=> 'dropdown-pages',
			'active_callback' => 'return_blog_if_cta_page'
		)
	);
}
