<?php
/**
 * Tattoopress customizer blog mods
 *
 * @package WordPress
 * @subpackage Tattoopress
 * @version 3.3.4
 */

defined( 'ABSPATH' ) || exit;

/**
 * Blog mods
 *
 * @param array $mods Array of mods.
 * @return array
 */
function tattoopress_set_post_mods( $mods ) {

	$mods['blog'] = array(
		'id'      => 'blog',
		'icon'    => 'welcome-write-blog',
		'title'   => esc_html__( 'Blog', 'tattoopress' ),
		'options' => array(

			'post_layout'           => array(
				'id'          => 'post_layout',
				'label'       => esc_html__( 'Blog Archive Layout', 'tattoopress' ),
				'type'        => 'select',
				'choices'     => array(
					'standard'      => esc_html__( 'Standard', 'tattoopress' ),
					'fullwidth'     => esc_html__( 'Full width', 'tattoopress' ),
					'sidebar-right' => esc_html__( 'Sidebar at right', 'tattoopress' ),
					'sidebar-left'  => esc_html__( 'Sidebar at left', 'tattoopress' ),
				),
				'transport'   => 'postMessage',
				'description' => esc_html__( 'For "Sidebar" layouts, the sidebar will be visible if it contains widgets.', 'tattoopress' ),
			),

			'post_display'          => array(
				'id'      => 'post_display',
				'label'   => esc_html__( 'Blog Archive Display', 'tattoopress' ),
				'type'    => 'select',
				'choices' => apply_filters(
					'tattoopress_post_display_options',
					array(
						'standard' => esc_html__( 'Standard', 'tattoopress' ),
					)
				),
			),

			'post_grid_padding'     => array(
				'id'        => 'post_grid_padding',
				'label'     => esc_html__( 'Padding (for grid style display only)', 'tattoopress' ),
				'type'      => 'select',
				'choices'   => array(
					'yes' => esc_html__( 'Yes', 'tattoopress' ),
					'no'  => esc_html__( 'No', 'tattoopress' ),
				),
				'transport' => 'postMessage',
			),

			'date_format'           => array(
				'id'      => 'date_format',
				'label'   => esc_html__( 'Blog Date Format', 'tattoopress' ),
				'type'    => 'select',
				'choices' => array(
					''           => esc_html__( 'Default', 'tattoopress' ),
					'human_diff' => esc_html__( '"X Time ago"', 'tattoopress' ),
				),
			),

			'post_pagination'       => array(
				'id'      => 'post_pagination',
				'label'   => esc_html__( 'Blog Archive Pagination', 'tattoopress' ),
				'type'    => 'select',
				'choices' => array(
					'standard_pagination' => esc_html__( 'Numeric Pagination', 'tattoopress' ),
					'load_more'           => esc_html__( 'Load More Button', 'tattoopress' ),
				),
			),

			'post_excerpt_type'     => array(
				'id'          => 'post_excerpt_type',
				'label'       => esc_html__( 'Blog Archive Post Excerpt Type', 'tattoopress' ),
				'type'        => 'select',
				'choices'     => array(
					'auto'   => esc_html__( 'Auto', 'tattoopress' ),
					'manual' => esc_html__( 'Manual', 'tattoopress' ),
				),
				'description' => sprintf( tattoopress_kses( __( 'Only for the "Standard" display type. To split your post manually, you can use the <a href="%s" target="_blank">"read more"</a> tag.', 'tattoopress' ) ), 'https://codex.wordpress.org/Customizing_the_Read_More' ),
			),

			'post_single_layout'    => array(
				'id'      => 'post_single_layout',
				'label'   => esc_html__( 'Single Post Layout', 'tattoopress' ),
				'type'    => 'select',
				'choices' => array(
					'sidebar-right' => esc_html__( 'Sidebar Right', 'tattoopress' ),
					'sidebar-left'  => esc_html__( 'Sidebar Left', 'tattoopress' ),
					'no-sidebar'    => esc_html__( 'No Sidebar', 'tattoopress' ),
					'fullwidth'     => esc_html__( 'Full width', 'tattoopress' ),
				),
			),

			'post_author_box'       => array(
				'id'      => 'post_author_box',
				'label'   => esc_html__( 'Single Post Author Box', 'tattoopress' ),
				'type'    => 'select',
				'choices' => array(
					'yes' => esc_html__( 'Yes', 'tattoopress' ),
					'no'  => esc_html__( 'No', 'tattoopress' ),
				),
			),

			'post_related_posts'    => array(
				'id'      => 'post_related_posts',
				'label'   => esc_html__( 'Single Post Related Posts', 'tattoopress' ),
				'type'    => 'select',
				'choices' => array(
					'yes' => esc_html__( 'Yes', 'tattoopress' ),
					'no'  => esc_html__( 'No', 'tattoopress' ),
				),
			),

			'post_item_animation'   => array(
				'label'   => esc_html__( 'Blog Archive Item Animation', 'tattoopress' ),
				'id'      => 'post_item_animation',
				'type'    => 'select',
				'choices' => tattoopress_get_animations(),
			),

			'post_display_elements' => array(
				'id'          => 'post_display_elements',
				'label'       => esc_html__( 'Elements to show by default', 'tattoopress' ),
				'type'        => 'group_checkbox',
				'choices'     => array(
					'show_thumbnail'  => esc_html__( 'Thumbnail', 'tattoopress' ),
					'show_date'       => esc_html__( 'Date', 'tattoopress' ),
					'show_text'       => esc_html__( 'Text', 'tattoopress' ),
					'show_category'   => esc_html__( 'Category', 'tattoopress' ),
					'show_author'     => esc_html__( 'Author', 'tattoopress' ),
					'show_tags'       => esc_html__( 'Tags', 'tattoopress' ),
					'show_extra_meta' => esc_html__( 'Extra Meta', 'tattoopress' ),
				),
				'description' => esc_html__( 'Note that some options may be ignored depending on the post display.', 'tattoopress' ),
			),
		),
	);

	if ( class_exists( 'Wolf_Custom_Post_Meta' ) ) {

		$mods['blog']['options'][] = array(
			'label'   => esc_html__( 'Enable Custom Post Meta', 'tattoopress' ),
			'id'      => 'enable_custom_post_meta',
			'type'    => 'group_checkbox',
			'choices' => array(
				'post_enable_views'        => esc_html__( 'Views', 'tattoopress' ),
				'post_enable_likes'        => esc_html__( 'Likes', 'tattoopress' ),
				'post_enable_reading_time' => esc_html__( 'Reading Time', 'tattoopress' ),
			),
		);
	}

	return $mods;
}
add_filter( 'tattoopress_customizer_mods', 'tattoopress_set_post_mods' );
