<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Frontpage Call to action
 *
 * @package pawfect
 */

defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'pawfect_Customize_Homepage_Funfact_Option' ) ) :

	class pawfect_Customize_Homepage_Funfact_Option extends pawfect_Customize_Base_Option {

		/**
		 * Arguments for options.
		 *
		 * @return array
		 */
		public function elements() {

			return array(

			    'pawfect_main_funfact_heading'     => array(
					'setting' => array(),
					'control' => array(
						'type'    => 'heading',
				   		'priority'        => 1,
						'label'   => esc_html__( 'Funfact Options', 'pawfect' ),
						'section' => 'pawfect_theme_funfact',
					),
				),
			
			    	
				'pawfect_funfact_disabled'            => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'     => 'toggle',
						'priority' => 2,
						'label'    => esc_html__( 'Enable/Disable', 'pawfect' ),
						'section'  => 'pawfect_theme_funfact',
					),
				),

				// container
				'pawfect_funfact_container_size'     => array(
					'setting' => array(
						'default'			=> 'container',
						'sanitize_callback'	=> array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
					),
					'control' => array(
						'type'				=> 'radio',
						'priority'			=> 25,
						'is_default_type'	=> true,
						'label'				=> esc_html__( 'Funfact Width', 'pawfect' ),
						'section'			=> 'pawfect_theme_funfact',
						'choices'			=> array(
							'container'		=> esc_html__( 'Container', 'pawfect' ),
							'container-full'=> esc_html__( 'Container Full', 'pawfect' ),
						),
						'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_funfact_disabled',
                            true
                        ],
					),
				),
				// column layout
				'pawfect_funfact_column_layout'	=> array(
					'setting'	=> array(
						'default'           => 'col-md-3',
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
					),
					'control'	=> array(
						'type'		=> 'radio_image',
						'priority'	=> 30,
						'label'		=> esc_html__( 'Column Layout', 'pawfect' ),
						'section'	=> 'pawfect_theme_funfact',
						'choices'	=> array(
							'col-md-6'	=> PAWFECT_THEME_URL . '/assets/images/icons/column-2.png',
							'col-md-4'	=> PAWFECT_THEME_URL . '/assets/images/icons/column-3.png',
							'col-md-3'	=> PAWFECT_THEME_URL . '/assets/images/icons/column-4.png',
						),
						'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_funfact_disabled',
                            true
                        ],
					),
					
				),
				
				// Blog Count For Homepage 
				'pawfect_funfact_count' => array(
					'setting' => array(
						'default'           => array(
							'slider' => 4,
							'suffix' => '',
						),
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_slider' ),
					),
					'control' => array(
						'type' => 'pawfect-slider',
						'priority'    => 55,
						'label'       => esc_html__( 'HomePage Funfact Count', 'pawfect' ),
						'section'     => 'pawfect_theme_funfact',
						'input_attrs' => array(
							'min'  => 2,
							'max'  => 20,
							'step' => 1,
						),
						'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_funfact_disabled',
                            true
                        ],
					),
				),

			);
		}

	}

	//new pawfect_Customize_Homepage_Funfact_Option();

endif;


