<?php
/*Blog Page Settings*/

Kirki::add_section( 'post_loop_settings_section', array(
    'title'          => esc_html__( 'Blog & Archive Loop Settings', 'book-review-blog' ),
    'panel'          => 'book_review_blog_global_panel',
) );

Kirki::add_field( 'book_review_blog_config', array(
    'type'        => 'custom',
    'settings'    => 'sep_after_post_column',
    'label'       => '',
    'section'     => 'post_loop_settings_section',
    'default'     => '<hr>',
) );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'toggle',
    'settings'    => 'show_post_category',
    'label'       => esc_html__( 'Show Post Category', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => '1',
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'toggle',
    'settings'    => 'show_post_title',
    'label'       => esc_html__( 'Show Post Title', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => '1',
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'toggle',
    'settings'    => 'show_post_author',
    'label'       => esc_html__( 'Show Post Author', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => '1',
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'toggle',
    'settings'    => 'show_post_thumbnail',
    'label'       => esc_html__( 'Thumbnail  On//Off', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => '1',
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'select',
    'settings'    => 'post_loop_thumbnail_size',
    'label'       => esc_html__( 'Thumbnail Size', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => 'full',
    'multiple'    => 1,
    'choices'     => [
        'default' => esc_html__( 'Default', 'book-review-blog' ),
        'book-review-blog-latest-post-widget-thumb' => esc_html__( 'Thumbnail Size 120x120', 'book-review-blog' ),
        'book-review-blog-recent-post' => esc_html__( 'Thumbnail Size 120x132', 'book-review-blog' ),
        'book-review-blog-thumbnail-mobile' => esc_html__( 'Thumbnail Size 350x350', 'book-review-blog' ),
        'book-review-blog-list-thumbnail' => esc_html__( 'Thumbnail Size 380x360', 'book-review-blog' ),
        'book-review-blog-tall-thumbnail' => esc_html__( 'Thumbnail Size 280x380', 'book-review-blog' ),
        'book-review-blog-list-large-thumbnail' => esc_html__( 'Thumbnail Size 600x800', 'book-review-blog' ),
        'book-review-blog-grid-thumbnail' => esc_html__( 'Thumbnail Size 380x320', 'book-review-blog' ),
        'book-review-blog-thumbnail-medium' => esc_html__( 'Thumbnail Size 770x433', 'book-review-blog' ),
        'book-review-blog-thumbnail-large' => esc_html__( 'Thumbnail Size 1200x675', 'book-review-blog' ),
        'book-review-blog-thumbnail-featured' => esc_html__( 'Thumbnail Size 900x650', 'book-review-blog' ),
        'book-review-blog-header-single-product' => esc_html__( 'Thumbnail Size 1080x1080', 'book-review-blog' ),
        'book-review-blog-header-full' => esc_html__( 'Thumbnail Size 1920x1080', 'book-review-blog' ),
        'full' => esc_html__( 'Full', 'book-review-blog' ),
    ],
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'toggle',
    'settings'    => 'show_post_excerpt',
    'label'       => esc_html__( 'Show Post Excerpt', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => '1',
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'number',
    'settings'    => 'post_loop_excerpt_limit',
    'label'       => esc_html__( 'Post Excerpt Limit', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => 42,
    'choices'     => [
        'min'  => 0,
        'max'  => 400,
        'step' => 1,
    ],
    'active_callback' => [
        [
            'setting'  => 'show_post_excerpt',
            'operator' => '==',
            'value'    => '1',
        ],
    ],
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'toggle',
    'settings'    => 'show_post_date',
    'label'       => esc_html__( 'Show Post Date', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => '1',
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'toggle',
    'settings'    => 'show_post_read_more',
    'label'       => esc_html__( 'Show Read More Button', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => '1',
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'select',
    'settings'    => 'read_more_button_type',
    'label'       => esc_html__( 'Button Type', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => 'button',
    'multiple'    => 1,
    'choices'     => [
        'button' => esc_html__( 'Button', 'book-review-blog' ),
        'normal' => esc_html__( 'Normal', 'book-review-blog' ),
    ],
    'active_callback' => [
        [
            'setting'  => 'show_post_read_more',
            'operator' => '==',
            'value'    => '1',
        ],
    ],
] );

Kirki::add_field( 'book_review_blog_config', [
    'type'        => 'text',
    'settings'    => 'read_more_button_text',
    'label'       => esc_html__( 'Read More Button Text', 'book-review-blog' ),
    'section'     => 'post_loop_settings_section',
    'default'     => esc_html__('Read More', 'book-review-blog'),
    'active_callback' => [
        [
            'setting'  => 'show_post_read_more',
            'operator' => '==',
            'value'    => '1',
        ],
    ],
] );
