<?php

add_action('customize_register', 'kutu_customize');
function kutu_customize($wp_customize) {

	//__Anasayfa Ayarlari_________________________________________________________________________________________
		

		$categories = get_categories();
		$cats = array();
		$i = 0;
		foreach($categories as $category){
			if($i==0){
				$default = $category->slug;
				$i++;
			}
			$cats[$category->name] = $category->name;
		}
	//_____________________________________________________________
		$wp_customize->add_section('kutu_anasayfa_ayarlari', array(
				'title'          => __('Home Page Settings', 'kutu'),
				'priority'       => 35,
			));

		$wp_customize->add_setting('box1', array(
			'default' => $default,
			'sanitize_callback' => 'sanitize_text_field',
		));
		$wp_customize->add_control('box1', array(
			'settings' => 'box1',
			'label'   => __('Box 1','kutu'),
			'section'  => 'kutu_anasayfa_ayarlari',
			'type'    => 'select',
			'choices' => $cats,
		));
	//______________________________________________________

		$wp_customize->add_setting('box2', array(
			'default' => $default,
			'sanitize_callback' => 'sanitize_text_field',
		));

		$wp_customize->add_control('box2', array(
			'settings' => 'box2',
			'label'   => __('Box 2','kutu'),
			'section'  => 'kutu_anasayfa_ayarlari',
			'type'    => 'select',
			'choices' => $cats,
		));

	//______________________________________________________

		$wp_customize->add_setting('box3', array(
			'default' => $default,
			'sanitize_callback' => 'sanitize_text_field',
		));

		$wp_customize->add_control('box3', array(
			'settings' => 'box3',
			'label'   => __('Box 3','kutu'),
			'section'  => 'kutu_anasayfa_ayarlari',
			'type'    => 'select',
			'choices' => $cats,
		));

		//______________________________________________________

		$wp_customize->add_setting('box4', array(
			'default' => $default,
			'sanitize_callback' => 'sanitize_text_field',
		));

		$wp_customize->add_control('box4', array(
			'settings' => 'box4',
			'label'   => __('Box 4','kutu'),
			'section'  => 'kutu_anasayfa_ayarlari',
			'type'    => 'select',
			'choices' => $cats,
		));

		//______________________________________________________

		$wp_customize->add_setting('box5', array(
			'default' => $default,
			'sanitize_callback' => 'sanitize_text_field',
		));

		$wp_customize->add_control('box5', array(
			'settings' => 'box5',
			'label'   => __('Box 5','kutu'),
			'section'  => 'kutu_anasayfa_ayarlari',
			'type'    => 'select',
			'choices' => $cats,
		));

		//______________________________________________________

		$wp_customize->add_setting('box6', array(
			'default' => $default,
			'sanitize_callback' => 'sanitize_text_field',
		));

		$wp_customize->add_control('box6', array(
			'settings' => 'box6',
			'label'   => __('Box 6','kutu'),
			'section'  => 'kutu_anasayfa_ayarlari',
			'type'    => 'select',
			'choices' => $cats,
		));

		//______________________________________________________

		$wp_customize->add_setting('box7', array(
			'default' => $default,
			'sanitize_callback' => 'sanitize_text_field',
		));

		$wp_customize->add_control('box7', array(
			'settings' => 'box7',
			'label'   => __('Box 7','kutu'),
			'section'  => 'kutu_anasayfa_ayarlari',
			'type'    => 'select',
			'choices' => $cats,
		));

		//______________________________________________________

		$wp_customize->add_setting('box8', array(
			'default' => $default,
			'sanitize_callback' => 'sanitize_text_field',
		));

		$wp_customize->add_control('box8', array(
			'settings' => 'box8',
			'label'   => __('Box 8','kutu'),
			'section'  => 'kutu_anasayfa_ayarlari',
			'type'    => 'select',
			'choices' => $cats,
		));
		

	//Telif Hakki Ayarlari_________________________________________________________________________________________
		
		$wp_customize->add_section('kutu_telifhakki_ayarlari', array(
			'title'          => __('Copyright', 'kutu'),
			'priority'       => 110,
		) );

		$wp_customize->add_setting('telifhakki', array(
			'default'        => '',
			'sanitize_callback' => 'sanitize_textarea_field',
		) );

		$wp_customize->add_control('telifhakki', array(
			'section' => 'kutu_telifhakki_ayarlari',
			'label'   => __('Copyright', 'kutu'),
			'type'    => 'textarea',
		));
	//______________________________________________________


}

