<?php

// Prevent Direct Access
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

new \Kirki\Section( 'blog_section', array(
	'title'          => esc_html__('Blog', 'maxo-fa'),
	'priority'       => 20,
) );

// Suptitle
new \Kirki\Field\Text( array(
	'settings' => 'blog_suptitle',
	'label'    => esc_html__('Text Above Title', 'maxo-fa'),
	'section'  => 'blog_section',
) );

// Title
new \Kirki\Field\Text( array(
	'settings' => 'blog_title',
	'label'    => esc_html__('Title', 'maxo-fa'),
	'section'  => 'blog_section',
) );

// Date
new \Kirki\Field\Checkbox( array(
	'settings' => 'blog_section_date',
	'label'    => esc_html__('Show Publish Date', 'maxo-fa'),
	'section'  => 'blog_section',
	'default'  => true,
) );

// Author
new \Kirki\Field\Checkbox( array(
	'settings' => 'blog_section_author',
	'label'    => esc_html__('Show Post Author', 'maxo-fa'),
	'section'  => 'blog_section',
	'default'  => true,
) );

// Count
new \Kirki\Field\Number( array(
	'settings'    => 'blog_count',
	'label'       => esc_html__('Posts count', 'maxo-fa'),
	'description' => esc_html__('The posts count that are shown on the main page.', 'maxo-fa'),
	'section'     => 'blog_section',
	'default'     => '3',
) );

// All Posts Button
new \Kirki\Field\Checkbox( array(
	'settings' => 'blog_section_all_posts_button',
	'label'    => esc_html__('Show "View All Posts" Button', 'maxo-fa'),
	'section'  => 'blog_section',
	'default'  => true,
) );

// All Posts Button Text
new \Kirki\Field\Text( array(
	'settings' => 'blog_section_all_posts_button_text',
	'label'    => esc_html__('"View All Posts" Button Text', 'maxo-fa'),
	'section'  => 'blog_section',
	'default'  => esc_html__('View All Posts', 'maxo-fa'),
	'active_callback' => array(
		array(
			'setting'  => 'blog_section_all_posts_button',
			'operator' => '==',
			'value'    => true,
		)
	),
) );
