<?php

/**
 *  Faced Blog Page Option
 *
 * @since Faced 1.0.0
 *
 */
/*Blog Page Options*/
$wp_customize->add_section('faced_blog_page_section', array(
    'priority'       => 35,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
    'title'          => __('Blog Section Options', 'faced'),
    'panel'          => 'faced_panel',
));

/*Blog Page Layout Masonry*/
$wp_customize->add_setting('faced_options[faced-blog-page-masonry-normal]', array(
    'capability'        => 'edit_theme_options',
    'transport' => 'refresh',
    'default'           => $default['faced-blog-page-masonry-normal'],
    'sanitize_callback' => 'faced_sanitize_select'
));
$wp_customize->add_control('faced_options[faced-blog-page-masonry-normal]', array(
    'choices' => array(
        'normal'    => __('Normal Layout', 'faced'),
        'masonry'   => __('Masonry Layout', 'faced'),
        'full-image'   => __('Full Image Layout', 'faced'),
    ),
    'label'     => __('Masonry or Normal Layout', 'faced'),
    'description' => __('Some image layout option will not work in masonry.', 'faced'),
    'section'   => 'faced_blog_page_section',
    'settings'  => 'faced_options[faced-blog-page-masonry-normal]',
    'type'      => 'select',
    'priority'  => 10,
));

/*Blog Page Show content from*/
$wp_customize->add_setting('faced_options[faced-content-show-from]', array(
    'capability'        => 'edit_theme_options',
    'transport' => 'refresh',
    'default'           => $default['faced-content-show-from'],
    'sanitize_callback' => 'faced_sanitize_select'
));
$wp_customize->add_control('faced_options[faced-content-show-from]', array(
    'choices' => array(
        'excerpt'    => __('Excerpt', 'faced'),
        'content'    => __('Content', 'faced'),
        'hide'    => __('Hide Content', 'faced'),
    ),
    'label'     => __('Select Content Display Option', 'faced'),
    'description' => __('You can enable excerpt from Screen Options inside post section of dashboard', 'faced'),
    'section'   => 'faced_blog_page_section',
    'settings'  => 'faced_options[faced-content-show-from]',
    'type'      => 'select',
    'priority'  => 10,
));

/*Blog image size*/
$wp_customize->add_setting('faced_options[faced-image-size-blog-page]', array(
    'capability'        => 'edit_theme_options',
    'transport' => 'refresh',
    'default'           => $default['faced-image-size-blog-page'],
    'sanitize_callback' => 'faced_sanitize_select'
));
$wp_customize->add_control('faced_options[faced-image-size-blog-page]', array(
    'choices' => array(
        'cropped-image'    => __('Cropped Image', 'faced'),
        'original-image'   => __('Original Image', 'faced'),
    ),
    'label'     => __('Size of the image, either cropped or original', 'faced'),
    'description' => __('The image will be either cropped or original size based on the image. Recommended image size is 800*600 px.', 'faced'),
    'section'   => 'faced_blog_page_section',
    'settings'  => 'faced_options[faced-image-size-blog-page]',
    'type'      => 'select',
    'priority'  => 10,
));

/*Blog Page excerpt length*/
$wp_customize->add_setting('faced_options[faced-excerpt-length]', array(
    'capability'        => 'edit_theme_options',
    'transport' => 'refresh',
    'default'           => $default['faced-excerpt-length'],
    'sanitize_callback' => 'absint'
));
$wp_customize->add_control('faced_options[faced-excerpt-length]', array(
    'label'     => __('Size of Excerpt Content', 'faced'),
    'description' => __('Enter the number per Words to show the content in blog page.', 'faced'),
    'section'   => 'faced_blog_page_section',
    'settings'  => 'faced_options[faced-excerpt-length]',
    'type'      => 'number',
    'priority'  => 10,
));
/*Blog Page Pagination Options*/
$wp_customize->add_setting('faced_options[faced-pagination-options]', array(
    'capability'        => 'edit_theme_options',
    'transport' => 'refresh',
    'default'           => $default['faced-pagination-options'],
    'sanitize_callback' => 'faced_sanitize_select'
));
$wp_customize->add_control('faced_options[faced-pagination-options]', array(
    'choices' => array(
        'default'    => __('Default', 'faced'),
        'numeric'    => __('Numeric', 'faced'),
        'ajax'    => __('Loading in Same Page', 'faced'),
    ),
    'label'     => __('Pagination Types', 'faced'),
    'description' => __('Select the Required Pagination Type', 'faced'),
    'section'   => 'faced_blog_page_section',
    'settings'  => 'faced_options[faced-pagination-options]',
    'type'      => 'select',
    'priority'  => 10,
));
/*Blog Page read more text*/
$wp_customize->add_setting('faced_options[faced-read-more-text]', array(
    'capability'        => 'edit_theme_options',
    'transport' => 'refresh',
    'default'           => $default['faced-read-more-text'],
    'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('faced_options[faced-read-more-text]', array(
    'label'     => __('Enter Read More Text', 'faced'),
    'description' => __('Read more text for blog and archive page.', 'faced'),
    'section'   => 'faced_blog_page_section',
    'settings'  => 'faced_options[faced-read-more-text]',
    'type'      => 'text',
    'priority'  => 10,
));
