<?php
/**
 * The Filter Post Meta-box configurations.
 *
 * @package Smart_Post_Show_Pro
 * @subpackage admin
 */

if ( ! defined( 'ABSPATH' ) ) {
	die;
} // Cannot access pages directly.

/**
 * The Filter post building class.
 */
class SPSP_FilterPost {

	/**
	 * Filter Post section metabox.
	 *
	 * @param string $prefix The metabox key.
	 * @return void
	 */
	public static function section( $prefix ) {
		SP_PCP::createSection(
			$prefix,
			array(
				'title'  => __( 'Filter Content', 'smart-post-show-pro' ),
				'icon'   => 'sps-icon-filter',
				'fields' => array(
					array(
						'id'            => 'pcp_select_post_type',
						'type'          => 'select',
						'title'         => __( 'Post Type(s)', 'smart-post-show-pro' ),
						'subtitle'      => __( 'Select post type(s).', 'smart-post-show-pro' ),
						'options'       => 'post_type',
						'multiple_type' => true,
						'class'         => 'sp_pcp_post_type',
						'default'       => 'post',
						'attributes'    => array(
							'style' => 'min-width: 150px;',
						),
					),
					array(
						'id'          => 'pcp_select_multiple_post_type',
						'type'        => 'select',
						'title'       => __( 'Multiple Post Types', 'smart-post-show-pro' ),
						'subtitle'    => __( 'Select multiple post type(s).', 'smart-post-show-pro' ),
						'options'     => 'post_type',
						'default'     => '',
						'desc'        => __( 'Leave it empty to show all post types.', 'smart-post-show-pro' ),
						'multiple'    => true,
						'chosen'      => true,
						'class'       => 'sp_pcp_post_type pcp_select_multi_posts',
						'placeholder' => __( 'Select multiple post type(s)', 'smart-post-show-pro' ),
						'dependency'  => array( 'pcp_select_post_type', '==', 'multiple_post_type' ),
					),
					array(
						'id'         => 'pcp_select_filter_product_type',
						'type'       => 'select',
						'title'      => __( 'Filter Products', 'smart-post-show-pro' ),
						'subtitle'   => __( 'Select a product type for filtering.', 'smart-post-show-pro' ),
						'options'    => array(
							'recent'       => __( 'Recent', 'smart-post-show-pro' ),
							'featured'     => __( 'Featured', 'smart-post-show-pro' ),
							'on_sale'      => __( 'On Sale', 'smart-post-show-pro' ),
							'best_selling' => __( 'Best Selling', 'smart-post-show-pro' ),
							'top_rated'    => __( 'Top Rated', 'smart-post-show-pro' ),
							'out_of_stock' => __( 'Out of Stock', 'smart-post-show-pro' ),
							'none'         => __( 'None of Above', 'smart-post-show-pro' ),
						),
						'default'    => 'none',
						'dependency' => array( 'pcp_select_post_type', '==', 'product' ),
					),
					array(
						'type'    => 'subheading',
						'content' => __( 'Common Filtering', 'smart-post-show-pro' ),
					),
					array(
						'id'         => 'pcp_sticky_post',
						'type'       => 'radio',
						'title'      => __( 'Sticky Post', 'smart-post-show-pro' ),
						'subtitle'   => __( 'Choose a position for sticky post.', 'smart-post-show-pro' ),
						'options'    => array(
							'normal_position' => __( 'Normal Position', 'smart-post-show-pro' ),
							'top_list'        => __( 'Top of the List', 'smart-post-show-pro' ),
							'hide'            => __( 'Hide Sticky Posts', 'smart-post-show-pro' ),
						),
						'default'    => 'normal_position',
						'dependency' => array( 'pcp_select_post_type', '==', 'post' ),
					),
					array(
						'id'          => 'pcp_include_only_posts',
						'type'        => 'select',
						'title'       => __( 'Include Only', 'smart-post-show-pro' ),
						'subtitle'    => __( 'Choose posts to include by title.', 'smart-post-show-pro' ),
						'options'     => 'posts',
						'ajax'        => true,
						'sortable'    => true,
						'chosen'      => true,
						'class'       => 'sp_pcp_include_only_posts',
						'multiple'    => true,
						'placeholder' => __( 'Choose posts', 'smart-post-show-pro' ),
						'query_args'  => array(
							'cache_results' => true,
							'no_found_rows' => true,
						),
					),
					array(
						'id'       => 'pcp_exclude_post_set',
						'type'     => 'fieldset',
						'title'    => __( 'Exclude', 'smart-post-show-pro' ),
						'subtitle' => __( 'Choose posts to exclude by title.', 'smart-post-show-pro' ),
						'class'    => 'sp_pcp_exclude_post_set',
						'fields'   => array(
							array(
								'id'          => 'pcp_exclude_posts',
								'type'        => 'select',
								'options'     => 'posts',
								'chosen'      => true,
								'class'       => 'sp_pcp_exclude_posts',
								'multiple'    => true,
								'ajax'        => true,
								'placeholder' => __( 'Choose posts to exclude', 'smart-post-show-pro' ),
								'query_args'  => array(
									'cache_results' => false,
									'no_found_rows' => true,
								),
								'dependency'  => array( 'pcp_include_only_posts', '==', '', true ),
							),
							array(
								'id'      => 'pcp_exclude_too',
								'type'    => 'checkbox',
								'class'   => 'sp_pcp_exclude_too',
								'options' => array(
									'current'            => __( 'Current Post', 'smart-post-show-pro' ),
									'password_protected' => __( 'Password Protected Posts', 'smart-post-show-pro' ),
									'children'           => __( 'Children Posts', 'smart-post-show-pro' ),
								),
							),
						),
					),
					array(
						'id'       => 'pcp_post_limit',
						'title'    => __( 'Limit', 'smart-post-show-pro' ),
						'type'     => 'spinner',
						'subtitle' => __( 'Number of total items to display. Leave it empty to show all found items.', 'smart-post-show-pro' ),
						// 'sanitize' => 'pcp_sanitize_number_field',
						'default'  => '20',
						'min'      => 1,
					),
					array(
						'id'       => 'pcp_post_offset',
						'type'     => 'spinner',
						'title'    => __( 'Offset', 'smart-post-show-pro' ),
						'subtitle' => __( 'Number of items to skip.', 'smart-post-show-pro' ),
						'sanitize' => 'pcp_sanitize_number_field',
						'default'  => 0,
					),
					array(
						'type'    => 'subheading',
						'content' => __( 'Advanced Filtering', 'smart-post-show-pro' ),
					),
					array(
						'id'       => 'pcp_advanced_filter',
						'type'     => 'checkbox',
						'class'    => 'spf_column_2 pcp_advanced_filter',
						'title'    => __( 'Filter By', 'smart-post-show-pro' ),
						'subtitle' => __( 'Check the option(s) to filter by.', 'smart-post-show-pro' ),
						'options'  => array(
							'taxonomy'     => __( 'Taxonomy (Categories, Tags...)', 'smart-post-show-pro' ),
							'author'       => __( 'Author', 'smart-post-show-pro' ),
							'sortby'       => __( 'Sort By', 'smart-post-show-pro' ),
							'custom_field' => __( 'Custom Fields', 'smart-post-show-pro' ),
							'status'       => __( 'Status', 'smart-post-show-pro' ),
							'date'         => __( 'Date', 'smart-post-show-pro' ),
							'keyword'      => __( 'Keyword', 'smart-post-show-pro' ),
						),
					),
					array(
						'id'         => 'pcp_filter_by_taxonomy',
						'type'       => 'accordion',
						'class'      => 'padding-t-0 pcp-opened-accordion filter_by_style pcp-filter-by-taxonomy',
						'accordions' => array(
							array(
								'title'  => __( 'Taxonomy (Categories, Tags...)', 'smart-post-show-pro' ),
								'icon'   => 'fa fa-folder-open',
								'fields' => array(
									// The Group Fields.
									array(
										'id'     => 'pcp_taxonomy_and_terms',
										'type'   => 'group',
										'class'  => 'pcp_taxonomy_terms_group pcp_custom_group_design',
										'accordion_title_auto' => true,
										'fields' => array(
											array(
												'id'     => 'pcp_taxonomy_select_data',
												'class'  => 'pcp_taxonomy_select_data',
												'type'   => 'fieldset',
												'fields' => array(
													array(
														'id'      => 'pcp_select_taxonomy',
														'type'    => 'select',
														'title'   => __( 'Taxonomy Type', 'smart-post-show-pro' ),
														'class'   => 'sp_pcp_post_taxonomy',
														'options' => 'taxonomy',
														'query_args' => array(
															'type' => 'post',
														),
														'attributes' => array(
															'style' => 'width: 200px;',
														),
														'empty_message' => __( 'No taxonomies found.', 'smart-post-show-pro' ),
													),
													array(
														'id'   => 'hide_taxonomy_name',
														'type' => 'checkbox',
														'title' => __( 'Hide Taxonomy Name', 'smart-post-show-pro' ),
														'class' => 'hide_taxonomy_name',
														'default' => false,
													),
												),
											),
											array(
												'id'       => 'pcp_select_terms',
												'type'     => 'select',
												'title'    => __( 'Choose Term(s)', 'smart-post-show-pro' ),
												'title_help' => __( 'Choose the taxonomy term(s) to show the posts from. Leave empty to show all found taxonomy term(s).', 'smart-post-show-pro' ),
												'options'  => 'terms',
												'class'    => 'sp_pcp_taxonomy_terms',
												'width'    => '300px',
												'multiple' => true,
												'sortable' => true,
												'empty_message' => __( 'No terms found.', 'smart-post-show-pro' ),
												'placeholder' => __( 'Select Term(s)', 'smart-post-show-pro' ),
												'chosen'   => true,
												'dependency' => array( 'pcp_select_taxonomy', '!=', '' ),
											),
											array(
												'id'      => 'pcp_taxonomy_term_operator',
												'type'    => 'select',
												'title'   => __( 'Operator', 'smart-post-show-pro' ),
												'options' => array(
													'IN'  => __( 'IN', 'smart-post-show-pro' ),
													'AND' => __( 'AND', 'smart-post-show-pro' ),
													'NOT IN' => __( 'NOT IN', 'smart-post-show-pro' ),
												),
												'default' => 'IN',
												'title_help' => sprintf(
													// Translators: %1$s and %2$s are opening and closing <br> tags.
													__( 'IN - Show posts which associate with one or more terms%1$sAND - Show posts which match all terms%1$sNOT IN - Show posts which don\'t match the terms', 'smart-post-show-pro' ),
													'<br>'
												),
												'dependency' => array( 'pcp_select_taxonomy', '!=', '' ),
											),
											array(
												'id'    => 'add_filter_post',
												'class' => 'pcp-taxonomy-post-filter',
												'type'  => 'checkbox',
												'title' => __( 'Add to Ajax Live Filters', 'smart-post-show-pro' ),
												'title_help' => __( 'Check to add ajax live filters.', 'smart-post-show-pro' ),
												'dependency' => array( 'pcp_select_taxonomy', '!=', '' ),
											),
											array(
												'type'    => 'subheading',
												'class'   => 'pcp-ajax-live-filters-subheading',
												'content' => __( 'Ajax Live Filters (Frontend)', 'smart-post-show-pro' ),
												'dependency' => array( 'add_filter_post', '==', 'true' ),
											),
											array(
												'id'     => 'ajax_filter_options',
												'type'   => 'fieldset',
												'title'  => __( 'Ajax Live Filters', 'smart-post-show-pro' ),
												'class'  => 'ajax-live-filters',
												'dependency' => array( 'add_filter_post', '==', 'true' ),
												'fields' => array(
													array(
														'id'       => 'ajax_filter_style',
														'class'    => 'hide-active-sign',
														'type'     => 'layout_preset',
														'title'    => __( 'Filter Type', 'smart-post-show-pro' ),
														'title_help' => __( 'Select a type for live filter.', 'smart-post-show-pro' ),
														'options'  => array(
															'fl_dropdown'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/dropdown.svg',
																'text'  => __( 'Dropdown', 'smart-post-show-pro' ),
															),
															'fl_radio'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/radio.svg',
																'text'  => __( 'Radio', 'smart-post-show-pro' ),
															),
															'fl_checkbox'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/check.svg',
																'text'  => __( 'Checkbox', 'smart-post-show-pro' ),
															),
															'fl_btn'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/button.svg',
																'text'  => __( 'Button', 'smart-post-show-pro' ),
															),
														),
														'default'  => 'fl_btn',
													),
													array(
														'id'   => 'ajax_filter_label',
														'type' => 'text',
														'title' => __( 'Override Taxonomy Label', 'smart-post-show-pro' ),
														'title_help' => __( 'Type live filter label.', 'smart-post-show-pro' ),
													),
													array(
														'id'   => 'ajax_hide_empty',
														'type' => 'checkbox',
														'title' => __( 'Hide Empty Term(s)', 'smart-post-show-pro' ),
														'title_help' => __( 'Check to hide empty terms.', 'smart-post-show-pro' ),
													),
													array(
														'id'       => 'ajax_rename_all_text',
														'type'     => 'text',
														'title'    => __( '"All" Tab Label', 'smart-post-show-pro' ),
														'title_help' => __( 'Leave it empty to hide "All" text.', 'smart-post-show-pro' ),
														'default'  => 'All',
														'dependency' => array( 'ajax_filter_style', '!=', 'fl_checkbox' ),
													),
													array(
														'id' => 'ajax_show_count',
														'title' => __( 'Post Counter', 'smart-post-show-pro' ),
														'title_help' => __( 'Check to show post count.', 'smart-post-show-pro' ),
														'type' => 'switcher',
														'default'  => false,
														'text_on'  => __( 'Show', 'smart-post-show-pro' ),
														'text_off' => __( 'Hide', 'smart-post-show-pro' ),
														'text_width' => 80,
													),
													array(
														'id'       => 'pcp_filter_btn_color',
														'type'     => 'color_group',
														'title'    => __( 'Filter Button Color', 'smart-post-show-pro' ),
														'options'  => array(
															'text_color'        => __( 'Text Color', 'smart-post-show-pro' ),
															'text_acolor'       => __( 'Text Hover', 'smart-post-show-pro' ),
															'background'        => __( 'Background', 'smart-post-show-pro' ),
															'active_background' => __( 'Active/Hover BG', 'smart-post-show-pro' ),
														),
														'default'  => array(
															'text_color'        => '#5e5e5e',
															'text_acolor'       => '#ffffff',
															'background'        => '#ffffff',
															'active_background' => '#e1624b',
														),
														'dependency' => array( 'ajax_filter_style', '==', 'fl_btn' ),
													),
													array(
														'id'      => 'pcp_ajax_filter_btn_border',
														'type'    => 'border',
														'title'   => __( 'Border', 'smart-post-show-pro' ),
														'all'     => true,
														'hover_color' => true,
														'border_radius'      => true,
														'default' => array(
															'all' => '1',
															'style' => 'solid',
															'color' => '#bbbbbb',
															'hover_color' => '#e1624b',
															'border_radius' => '2',
														),
														'dependency' => array( 'ajax_filter_style', 'any', 'fl_btn,fl_dropdown' ),
													),
													array(
														'id'       => 'pcp_live_filter_align',
														'type'     => 'button_set',
														'title'    => __( 'Alignment', 'smart-post-show-pro' ),
														'options' => array(
															'left' => '<i class="fa fa-align-left" title="Left"></i>',
															'center' => '<i class="fa fa-align-center" title="Center"></i>',
															'right' => '<i class="fa fa-align-right" title="Right"></i>',
														),
														'default'  => 'center',
													),
													array(
														'id'         => 'pcp_margin_between_button',
														'type'       => 'spacing',
														'title'      => __( 'Space Between Buttons', 'smart-post-show-pro' ),
														'sanitize'   => 'pcp_sanitize_number_array_field',
														'title_info'   => __( 'Set space between buttons.', 'smart-post-show-pro' ),
														'units'      => array( 'px' ),
														'default'    => array(
															'top'    => '0',
															'right'  => '8',
															'bottom' => '8',
															'left'   => '0',
															'unit'   => 'px',
														),
														'dependency' => array( 'ajax_filter_style', '==', 'fl_btn' ),
													),
												),
											),

										),
									), // Group field end.
									array(
										'id'         => 'pcp_taxonomies_relation',
										'type'       => 'select',
										'title'      => __( 'Relation', 'smart-post-show-pro' ),
										'class'      => 'pcp_relate_among_taxonomies',
										'options'    => array(
											'AND' => __( 'AND', 'smart-post-show-pro' ),
											'OR'  => __( 'OR', 'smart-post-show-pro' ),
										),
										'default'    => 'AND',
										'title_help' => __( 'The logical relationship between/among above taxonomies.', 'smart-post-show-pro' ),
									),

								), // Fields array.
							),
						), // Accordions end.
						'dependency' => array( 'pcp_advanced_filter', 'not-any', 'author,sortby,custom_field,status,date,keyword' ),
					),
					array(
						'id'         => 'pcp_filter_by_author',
						'type'       => 'accordion',
						'class'      => 'padding-t-0 pcp-opened-accordion filter_by_style pcp-filter-by-author',
						'accordions' => array(
							array(
								'title'  => 'Author',
								'icon'   => 'fa fa-user',
								'fields' => array(
									array(
										'id'      => 'pcp_select_author_by',
										'type'    => 'checkbox',
										'title'   => __( 'Post by Author', 'smart-post-show-pro' ),
										'options' => 'users',
									),
									array(
										'id'      => 'pcp_select_author_not_by',
										'type'    => 'checkbox',
										'title'   => __( 'Post Not by Author ', 'smart-post-show-pro' ),
										'options' => 'users',
									),
									array(
										'id'         => 'add_author_filter_post',
										'class'      => 'pcp-add-author-filter-post',
										'type'       => 'checkbox',
										'title'      => __( 'Add to Ajax Live Filters', 'smart-post-show-pro' ),
										'title_help' => __( 'Check to add ajax live filters.', 'smart-post-show-pro' ),
										'dependency' => array( 'pcp_layout_preset', '!=', 'filter_layout', true ),
									),
									array(
										'type'       => 'subheading',
										'content'    => __( 'Ajax Live Filters (Frontend)', 'smart-post-show-pro' ),
										'dependency' => array( 'add_author_filter_post', '==', 'true', true ),
									),
									array(
										'id'         => 'ajax_filter_options',
										'class'      => 'ajax-live-filters',
										'type'       => 'fieldset',
										'title'      => __( 'Ajax Live Filters', 'smart-post-show-pro' ),
										'dependency' => array( 'add_author_filter_post', '==', 'true', true ),
										'fields'     => array(
											array(
												'id'      => 'ajax_filter_style',
												'class'   => 'hide-active-sign',
												'type'    => 'layout_preset',
												'title'   => __( 'Filter Type', 'smart-post-show-pro' ),
												'title_help' => __( 'Select a type for live filter.', 'smart-post-show-pro' ),
												'options' => array(
													'fl_dropdown'  => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/dropdown.svg',
														'text'  => __( 'Dropdown', 'smart-post-show-pro' ),
													),
													'fl_radio'  => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/radio.svg',
														'text'  => __( 'Radio', 'smart-post-show-pro' ),
													),
													'fl_btn'  => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/button.svg',
														'text'  => __( 'Button', 'smart-post-show-pro' ),
													),
												),
												'default' => 'fl_btn',
											),
											array(
												'id'    => 'ajax_filter_label',
												'type'  => 'text',
												'title' => __( 'Override Taxonomy Label', 'smart-post-show-pro' ),
												'title_help' => __( 'Type live filter label.', 'smart-post-show-pro' ),
											),
											array(
												'id'      => 'ajax_rename_all_text',
												'type'    => 'text',
												'title'   => __( '"All" Tab Label', 'smart-post-show-pro' ),
												'title_help' => __( 'Rename "All" text.', 'smart-post-show-pro' ),
												'default' => 'All',
											),
											array(
												'id'    => 'ajax_hide_empty',
												'type'  => 'checkbox',
												'title' => __( 'Hide Empty author', 'smart-post-show-pro' ),
												'title_help' => __( 'Check to hide empty author.', 'smart-post-show-pro' ),
											),
											array(
												'id'       => 'ajax_show_count',
												'title'    => __( 'Post Counter', 'smart-post-show-pro' ),
												'title_help' => __( 'Check to show post count.', 'smart-post-show-pro' ),
												'type'     => 'switcher',
												'default'  => false,
												'text_on'  => __( 'Show', 'smart-post-show-pro' ),
												'text_off' => __( 'Hide', 'smart-post-show-pro' ),
												'text_width' => 80,
											),
											array(
												'id'      => 'pcp_author_btn_color',
												'type'    => 'color_group',
												'title'   => __( 'Button Color', 'smart-post-show-pro' ),
												'dependency' => array( 'ajax_filter_style', '==', 'fl_btn' ),
												'options' => array(
													'text_color'        => __( 'Text Color', 'smart-post-show-pro' ),
													'text_acolor'       => __( 'Text Hover', 'smart-post-show-pro' ),
													'background'        => __( 'Background', 'smart-post-show-pro' ),
													'active_background' => __( 'Active/Hover BG', 'smart-post-show-pro' ),
												),
												'default' => array(
													'text_color'        => '#5e5e5e',
													'text_acolor'       => '#ffffff',
													'background'        => '#ffffff',
													'active_background' => '#e1624b',
												),
											),
											array(
												'id'      => 'pcp_author_border',
												'type'    => 'border',
												'title'   => __( 'Border', 'smart-post-show-pro' ),
												'all'     => true,
												'hover_color' => true,
												'border_radius' => true,
												'default' => array(
													'all' => '1',
													'style' => 'solid',
													'color' => '#bbbbbb',
													'hover_color' => '#e1624b',
													'border_radius' => '2',
												),
												'dependency' => array( 'ajax_filter_style', 'any', 'fl_dropdown,fl_btn' ),
											),
											array(
												'id'      => 'pcp_live_filter_align',
												'type'    => 'button_set',
												'title'   => __( 'Alignment', 'smart-post-show-pro' ),
												'options' => array(
													'left' => '<i class="fa fa-align-left" title="Left"></i>',
													'center' => '<i class="fa fa-align-center" title="Center"></i>',
													'right' => '<i class="fa fa-align-right" title="Right"></i>',
												),
												'default' => 'center',
											),
											array(
												'id'       => 'author_margin_between_button',
												'type'     => 'spacing',
												'title'    => __( 'Space Between Buttons', 'smart-post-show-pro' ),
												'sanitize' => 'pcp_sanitize_number_array_field',
												'units'    => array( 'px' ),
												'default'  => array(
													'top'  => '0',
													'right' => '8',
													'bottom' => '8',
													'left' => '0',
													'unit' => 'px',
												),
												'dependency' => array( 'ajax_filter_style', '==', 'fl_btn' ),
											),
										),
									),
								),
							),
						),
						'dependency' => array( 'pcp_advanced_filter', 'not-any', 'taxonomy,sortby,custom_field,status,date,keyword' ),
					),
					array(
						'id'         => 'pcp_filter_by_order',
						'type'       => 'accordion',
						'class'      => 'padding-t-0 pcp-opened-accordion filter_by_style pcp-filter-by-order',
						'accordions' => array(
							array(
								'title'  => 'Sort By',
								'icon'   => 'fa fa-sort',
								'fields' => array(
									array(
										'id'      => 'pcp_select_filter_orderby',
										'type'    => 'select',
										'title'   => __( 'Order By', 'smart-post-show-pro' ),
										'options' => array(
											'ID'           => __( 'ID', 'smart-post-show-pro' ),
											'title'        => __( 'Title', 'smart-post-show-pro' ),
											'date'         => __( 'Date', 'smart-post-show-pro' ),
											'modified'     => __( 'Modified date', 'smart-post-show-pro' ),
											'post__in'     => __( 'Post in (Drag & Drop)', 'smart-post-show-pro' ),
											'name'         => __( 'Post slug', 'smart-post-show-pro' ),
											'post_type'    => __( 'Post type', 'smart-post-show-pro' ),
											'rand'         => __( 'Random', 'smart-post-show-pro' ),
											'comment_count' => __( 'Comment count', 'smart-post-show-pro' ),
											'menu_order'   => __( 'Menu order', 'smart-post-show-pro' ),
											'author'       => __( 'Author', 'smart-post-show-pro' ),
											'most_liked'   => __( 'Most Liked', 'smart-post-show-pro' ),
											'most_viewed'  => __( 'Most Viewed', 'smart-post-show-pro' ),
											'custom_field' => __( 'Custom Field', 'smart-post-show-pro' ),
										),
										'default' => 'date',
									),
									array(
										'id'         => 'orderby_custom_field_options',
										'type'       => 'fieldset',
										'class'      => 'ajax-live-filters',
										'title'      => __( 'Order by Custom Field', 'smart-post-show-pro' ),
										'dependency' => array( 'pcp_select_filter_orderby', '==', 'custom_field', true ),
										'fields'     => array(
											array(
												'id'      => 'pcp_select_custom_field_key',
												'type'    => 'select',
												'title'   => __( 'Custom Fields Keys', 'smart-post-show-pro' ),
												'title_help' => __( 'Select custom fields key.', 'smart-post-show-pro' ),
												'options' => 'custom_fields',
												'chosen'  => true,
												'attributes' => array(
													'style' => 'width: 200px;',
												),
												'empty_message' => __( 'No custom field keys found.', 'smart-post-show-pro' ),
											),
											array(
												'id'      => 'pcp_select_custom_field_value_type',
												'type'    => 'select',
												'title'   => __( 'Value Type', 'smart-post-show-pro' ),
												'title_help' => __( 'Select a value type.', 'smart-post-show-pro' ),
												'options' => array(
													'CHAR' => __( 'Text', 'smart-post-show-pro' ),
													'NUMERIC' => __( 'Number', 'smart-post-show-pro' ),
													'DATE' => __( 'Date', 'smart-post-show-pro' ),
													'BOOLEAN' => __( 'True/False', 'smart-post-show-pro' ),
												),
												'default' => 'NUMERIC',
											),
										),
									),
									array(
										'id'         => 'add_orderby_filter_post',
										'class'      => 'pcp-add-orderby-filter-post',
										'type'       => 'checkbox',
										'title'      => __( 'Add to Ajax Live Filters', 'smart-post-show-pro' ),
										'title_help' => __( 'Check to add ajax live filter for Order by.', 'smart-post-show-pro' ),
										'dependency' => array( 'pcp_layout_preset', '!=', 'filter_layout', true ),
									),
									array(
										'type'       => 'subheading',
										'content'    => __( 'Ajax Live Filters (Frontend)', 'smart-post-show-pro' ),
										'dependency' => array( 'add_orderby_filter_post', '==', 'true', true ),
									),
									array(
										'id'         => 'orderby_ajax_filter_options',
										'type'       => 'fieldset',
										'class'      => 'ajax-live-filters',
										'title'      => __( 'Ajax Live Filters', 'smart-post-show-pro' ),
										'fields'     => array(
											array(
												'id'      => 'orderby_filter_style',
												'class'   => 'hide-active-sign',
												'type'    => 'layout_preset',
												'title'   => __( 'Filter Type', 'smart-post-show-pro' ),
												'title_help' => __( 'Select a type for live filter.', 'smart-post-show-pro' ),
												'options' => array(
													'fl_dropdown' => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/dropdown.svg',
														'text' => __( 'Dropdown', 'smart-post-show-pro' ),
													),
													'fl_radio' => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/radio.svg',
														'text' => __( 'Radio', 'smart-post-show-pro' ),
													),
													'fl_btn'   => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/button.svg',
														'text' => __( 'Button', 'smart-post-show-pro' ),
													),
												),
												'default' => 'fl_dropdown',
											),
											array(
												'id'       => 'pcp_add_filter_orderby',
												'type'     => 'select',
												'title'    => __( 'Order By', 'smart-post-show-pro' ),
												'title_help' => __( 'Choose order by options to show to the visitors.', 'smart-post-show-pro' ),
												'chosen'   => true,
												'multiple' => true,
												'sortable' => true,
												'options'  => array(
													'ID'   => __( 'ID', 'smart-post-show-pro' ),
													'title' => __( 'Title', 'smart-post-show-pro' ),
													'date' => __( 'Date', 'smart-post-show-pro' ),
													'modified' => __( 'Modified date', 'smart-post-show-pro' ),
													'post_type' => __( 'Post type', 'smart-post-show-pro' ),
													'rand' => __( 'Random', 'smart-post-show-pro' ),
													'comment_count' => __( 'Comment count', 'smart-post-show-pro' ),
													'menu_order' => __( 'Menu order', 'smart-post-show-pro' ),
													'author' => __( 'Author', 'smart-post-show-pro' ),
													'most_liked' => __( 'Most Liked', 'smart-post-show-pro' ),
													'most_viewed' => __( 'Most Viewed', 'smart-post-show-pro' ),
												),
											),
											array(
												'id'      => 'ajax_filter_label',
												'type'    => 'text',
												'title'   => __( 'Label', 'smart-post-show-pro' ),
												'title_help' => __( 'Type live filter label.', 'smart-post-show-pro' ),
												'default' => 'Order by',
											),
											array(
												'id'      => 'pcp_orderby_filter_btn_color',
												'type'    => 'color_group',
												'title'   => __( 'Button Color', 'smart-post-show-pro' ),
												'dependency' => array( 'orderby_filter_style', '==', 'fl_btn' ),
												'options' => array(
													'text_color'   => __( 'Text Color', 'smart-post-show-pro' ),
													'text_acolor'  => __( 'Text Hover', 'smart-post-show-pro' ),
													'background'   => __( 'Background', 'smart-post-show-pro' ),
													'active_background' => __( 'Active/Hover BG', 'smart-post-show-pro' ),
												),
												'default' => array(
													'text_color'   => '#5e5e5e',
													'text_acolor'  => '#ffffff',
													'background'   => '#ffffff',
													'active_background' => '#e1624b',
												),
											),
											array(
												'id'      => 'pcp_orderby_filter_border',
												'type'    => 'border',
												'title'   => __( 'Border', 'smart-post-show-pro' ),
												'all'     => true,
												'hover_color' => true,
												'border_radius' => true,
												'default' => array(
													'all' => '1',
													'style' => 'solid',
													'color' => '#bbbbbb',
													'hover_color' => '#e1624b',
													'border_radius' => '2',
												),
												'dependency' => array( 'orderby_filter_style', 'any', 'fl_dropdown,fl_btn', true ),
											),
											array(
												'id'      => 'pcp_live_filter_align',
												'type'    => 'button_set',
												'title'   => __( 'Alignment', 'smart-post-show-pro' ),
												'options' => array(
													'left' => '<i class="fa fa-align-left" title="Left"></i>',
													'center' => '<i class="fa fa-align-center" title="Center"></i>',
													'right' => '<i class="fa fa-align-right" title="Right"></i>',
												),
												'default' => 'center',
											),
											array(
												'id'       => 'order_margin_between_button',
												'type'     => 'spacing',
												'title'    => __( 'Space Between Buttons', 'smart-post-show-pro' ),
												'sanitize' => 'pcp_sanitize_number_array_field',
												'title_info' => __( 'Set space between buttons.', 'smart-post-show-pro' ),
												'units'    => array( 'px' ),
												'default'  => array(
													'top'  => '0',
													'right' => '8',
													'bottom' => '8',
													'left' => '0',
													'unit' => 'px',
												),
												'dependency' => array( 'orderby_filter_style', '==', 'fl_btn' ),
											),
										),
										'dependency' => array( 'add_orderby_filter_post', '==', 'true' ),
									),
									array(
										'id'         => 'pcp_select_filter_order',
										'type'       => 'select',
										'title'      => __( 'Order', 'smart-post-show-pro' ),
										'options'    => array(
											'ASC'  => __( 'Ascending', 'smart-post-show-pro' ),
											'DESC' => __( 'Descending', 'smart-post-show-pro' ),
										),
										'default'    => 'DESC',
										'dependency' => array( 'pcp_select_filter_orderby', '!=', 'post__in' ),
									),
									array(
										'id'         => 'add_order_filter_post',
										'class'      => 'pcp-add-order-filter-post',
										'type'       => 'checkbox',
										'title'      => __( 'Add to Ajax Live Filters', 'smart-post-show-pro' ),
										'title_help' => __( 'Check to add ajax live filter for order.', 'smart-post-show-pro' ),
										'dependency' => array( 'pcp_select_filter_orderby|pcp_layout_preset', '!=|!=', 'post__in|filter_layout', true ),
									),
									array(
										'type'       => 'subheading',
										'content'    => __( 'Ajax Live Filters (Frontend)', 'smart-post-show-pro' ),
										'dependency' => array( 'pcp_select_filter_orderby|pcp_layout_preset|add_order_filter_post', '!=|!=|==', 'post__in|filter_layout|true', true ),
									),
									array(
										'id'         => 'order_filter_options',
										'type'       => 'fieldset',
										'title'      => __( 'Ajax Live Filters', 'smart-post-show-pro' ),
										'class'      => 'ajax-live-filters',
										'dependency' => array( 'add_order_filter_post|pcp_select_filter_orderby', '==|!=', 'true|post__in', true ),
										'fields'     => array(
											array(
												'id'      => 'order_filter_style',
												'class'   => 'hide-active-sign',
												'type'    => 'layout_preset',
												'title'   => __( 'Filter Type', 'smart-post-show-pro' ),
												'title_help' => __( 'Select a type for live filter.', 'smart-post-show-pro' ),
												'options' => array(
													'fl_dropdown'  => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/dropdown.svg',
														'text'  => __( 'Dropdown', 'smart-post-show-pro' ),
													),
													'fl_radio'  => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/radio.svg',
														'text'  => __( 'Radio', 'smart-post-show-pro' ),
													),
													'fl_btn'  => array(
														'image' => SP_PCP_URL . 'admin/img/filter-type/button.svg',
														'text'  => __( 'Button', 'smart-post-show-pro' ),
													),
												),
												'default' => 'fl_btn',
											),
											array(
												'id'      => 'order_filter_label',
												'type'    => 'text',
												'title'   => __( 'Label', 'smart-post-show-pro' ),
												'title_help' => __( 'Type live filter label.', 'smart-post-show-pro' ),
												'default' => 'Order',
											),
											array(
												'id'      => 'pcp_order_filter_button_color',
												'type'    => 'color_group',
												'title'   => __( 'Button Color', 'smart-post-show-pro' ),
												'dependency' => array( 'order_filter_style', '==', 'fl_btn' ),
												'options' => array(
													'text_color'        => __( 'Text Color', 'smart-post-show-pro' ),
													'text_acolor'       => __( 'Text Hover', 'smart-post-show-pro' ),
													'background'        => __( 'Background', 'smart-post-show-pro' ),
													'active_background' => __( 'Active/Hover BG', 'smart-post-show-pro' ),
												),
												'default' => array(
													'text_color'        => '#5e5e5e',
													'text_acolor'       => '#ffffff',
													'background'        => '#ffffff',
													'active_background' => '#e1624b',
												),
											),
											array(
												'id'      => 'pcp_order_filter_border',
												'type'    => 'border',
												'title'   => __( 'Border', 'smart-post-show-pro' ),
												'all'     => true,
												'hover_color' => true,
												'border_radius' => true,
												'default' => array(
													'all' => '1',
													'style' => 'solid',
													'color' => '#bbbbbb',
													'hover_color' => '#e1624b',
													'border_radius' => '2',
												),
												'dependency' => array( 'order_filter_style', 'any', 'fl_dropdown,fl_btn' ),
											),
											array(
												'id'      => 'pcp_live_filter_align',
												'type'    => 'button_set',
												'title'   => __( 'Alignment', 'smart-post-show-pro' ),
												'options' => array(
													'left' => '<i class="fa fa-align-left" title="Left"></i>',
													'center' => '<i class="fa fa-align-center" title="Center"></i>',
													'right' => '<i class="fa fa-align-right" title="Right"></i>',
												),
												'default' => 'center',
											),

										),
									),
								),
							),
						),
						'dependency' => array( 'pcp_advanced_filter', 'not-any', 'taxonomy,author,custom_field,status,date,keyword' ),
					),
					array(
						'id'         => 'pcp_filter_custom_field',
						'type'       => 'accordion',
						'class'      => 'padding-t-0 pcp-opened-accordion filter_by_style pcp-filter-custom-field',
						'accordions' => array(
							array(
								'title'  => __( 'Custom Fields', 'smart-post-show-pro' ),
								'icon'   => 'fa fa-th-list',
								'fields' => array(
									// The Group Fields.
									array(
										'id'     => 'pcp_filter_by_custom_field_group',
										'type'   => 'group',
										'class'  => 'pcp_filter_custom_field_group pcp_custom_group_design',
										'accordion_title_auto' => true,
										'fields' => array(
											array(
												'id'      => 'pcp_select_custom_field_key',
												'type'    => 'select',
												'title'   => __( 'Custom Fields Keys', 'smart-post-show-pro' ),
												'title_help' => __( 'Select custom fields key.', 'smart-post-show-pro' ),
												'options' => 'custom_fields',
												'chosen'  => true,
												'attributes' => array(
													'style' => 'width: 200px;',
												),
												'empty_message' => __( 'No custom field keys found.', 'smart-post-show-pro' ),
											),
											array(
												'id'      => 'pcp_select_custom_field_value_type',
												'type'    => 'select',
												'title'   => __( 'Value Type', 'smart-post-show-pro' ),
												'title_help' => __( 'Select a value type.', 'smart-post-show-pro' ),
												'options' => array(
													'CHAR' => __( 'Text', 'smart-post-show-pro' ),
													'NUMERIC' => __( 'Number', 'smart-post-show-pro' ),
													'DATE' => __( 'Date', 'smart-post-show-pro' ),
													'BOOLEAN' => __( 'True/False', 'smart-post-show-pro' ),
												),
												'default' => 'text',
											),
											array(
												'id'      => 'pcp_select_custom_compare_operator_text',
												'type'    => 'select',
												'title'   => __( 'Compare Operator', 'smart-post-show-pro' ),
												'title_help' => __( 'Select compare operator.', 'smart-post-show-pro' ),
												'options' => array(
													'='    => __( 'Equal (=)', 'smart-post-show-pro' ),
													'!='   => __( 'Not Equal (!=)', 'smart-post-show-pro' ),
													'LIKE' => __( 'Like', 'smart-post-show-pro' ),
													'NOT LIKE' => __( 'Not Like', 'smart-post-show-pro' ),
													'IN'   => __( 'In', 'smart-post-show-pro' ),
													'NOT IN' => __( 'Not In', 'smart-post-show-pro' ),
													'EXISTS' => __( 'Exists', 'smart-post-show-pro' ),
													'NOT EXISTS' => __( 'Not Exists', 'smart-post-show-pro' ),
												),
												'default' => 'text',
												'dependency' => array( 'pcp_select_custom_field_value_type|add_filter_post', '==|!=', 'CHAR|true' ),
											),
											array(
												'id'      => 'pcp_select_custom_compare_operator_number',
												'type'    => 'select',
												'title'   => __( 'Compare Operator', 'smart-post-show-pro' ),
												'title_help' => __( 'Select compare operator.', 'smart-post-show-pro' ),
												'options' => array(
													'='  => __( 'Equal (=)', 'smart-post-show-pro' ),
													'!=' => __( 'Not Equal (!=)', 'smart-post-show-pro' ),
													'>'  => __( 'Greater (>)', 'smart-post-show-pro' ),
													'>=' => __( 'Greater or Equal (>=)', 'smart-post-show-pro' ),
													'<'  => __( 'Less (<)', 'smart-post-show-pro' ),
													'<=' => __( 'Less or Equal (<=)', 'smart-post-show-pro' ),
													'IN' => __( 'In', 'smart-post-show-pro' ),
													'NOT IN' => __( 'Not In', 'smart-post-show-pro' ),
													'BETWEEN' => __( 'Between', 'smart-post-show-pro' ),
													'NOT BETWEEN' => __( 'Not Between', 'smart-post-show-pro' ),
													'EXISTS' => __( 'Exists', 'smart-post-show-pro' ),
													'NOT EXISTS' => __( 'Not Exists', 'smart-post-show-pro' ),
												),
												'default' => '=',
												'dependency' => array( 'pcp_select_custom_field_value_type|add_filter_post', '==|!=', 'NUMERIC|true' ),
											),
											array(
												'id'      => 'pcp_select_custom_compare_operator_date',
												'type'    => 'select',
												'title'   => __( 'Compare Operator', 'smart-post-show-pro' ),
												'title_help' => __( 'Select compare operator.', 'smart-post-show-pro' ),
												'options' => array(
													'TODAY' => __( 'Today', 'smart-post-show-pro' ),
													'NOW_PAST' => __( 'Now and Past', 'smart-post-show-pro' ),
													'NOW_FUTURE' => __( 'Now and Future', 'smart-post-show-pro' ),
													'IN_PAST' => __( 'In the past', 'smart-post-show-pro' ),
													'='  => __( 'Equal(=)', 'smart-post-show-pro' ),
													'!=' => __( 'Not Equal(!=)', 'smart-post-show-pro' ),
													'>'  => __( 'Greater(>)', 'smart-post-show-pro' ),
													'>=' => __( 'Greater or Equel (>=)', 'smart-post-show-pro' ),
													'<'  => __( 'Less (<)', 'smart-post-show-pro' ),
													'<=' => __( 'Less or Equal (<=)', 'smart-post-show-pro' ),
													'BETWEEN' => __( 'Between', 'smart-post-show-pro' ),
													'NOT BETWEEN' => __( 'Not Between', 'smart-post-show-pro' ),
													'EXISTS' => __( 'Exists', 'smart-post-show-pro' ),
													'NOT EXISTS' => __( 'Not Exists', 'smart-post-show-pro' ),
												),
												'default' => '=',
												'dependency' => array( 'pcp_select_custom_field_value_type|add_filter_post', '==|!=', 'DATE|true' ),
											),
											array(
												'id'      => 'pcp_select_custom_compare_operator_boolean',
												'type'    => 'select',
												'title'   => __( 'Compare Operator', 'smart-post-show-pro' ),
												'title_help' => __( 'Select compare operator.', 'smart-post-show-pro' ),
												'options' => array(
													'='  => __( 'Equal(=)', 'smart-post-show-pro' ),
													'!=' => __( 'Not Equal(!=)', 'smart-post-show-pro' ),
													'EXISTS' => __( 'Exists', 'smart-post-show-pro' ),
													'NOT EXISTS' => __( 'Not Exists', 'smart-post-show-pro' ),
												),
												'default' => '=',
												'dependency' => array( 'pcp_select_custom_field_value_type|add_filter_post', '==|!=', 'BOOLEAN|true' ),
											),
											array(
												'id'    => 'pcp_select_custom_field_text_value',
												'type'  => 'text',
												'title' => __( 'Compare Value', 'smart-post-show-pro' ),
												'title_help' => __( 'Type compare value.', 'smart-post-show-pro' ),
												'dependency' => array( 'pcp_select_custom_field_value_type|add_filter_post', 'any|!=', 'CHAR,NUMERIC|true' ),
											),
											array(
												'id'       => 'pcp_select_custom_field_date_value_from_to',
												'type'     => 'date',
												'title'    => __( 'Compare Value', 'smart-post-show-pro' ),
												'title_help' => __( 'Type compare value.', 'smart-post-show-pro' ),
												'settings' => array(
													'dateFormat' => 'yy-mm-dd',
												),
												'from_to'  => true,
												'text_from' => 'From',
												'text_to'  => 'To',
												'placeholder' => __( 'yy-mm-dd', 'smart-post-show-pro' ),
												'dependency' => array( 'pcp_select_custom_field_value_type|pcp_select_custom_compare_operator_date|add_filter_post', '==|any|!=', 'DATE|BETWEEN,NOT BETWEEN,EXISTS,NOT EXISTS|true' ),
											),
											array(
												'id'       => 'pcp_select_custom_field_date_value',
												'type'     => 'date',
												'title'    => __( 'Compare Value', 'smart-post-show-pro' ),
												'title_help' => __( 'Type compare value.', 'smart-post-show-pro' ),
												'settings' => array(
													'dateFormat' => 'yy-mm-dd',
												),
												'placeholder' => __( 'yy-mm-dd', 'smart-post-show-pro' ),
												'dependency' => array( 'pcp_select_custom_field_value_type|pcp_select_custom_compare_operator_date|add_filter_post', '==|not-any|!=', 'DATE|BETWEEN,NOT BETWEEN,EXISTS,NOT EXISTS|true' ),
											),
											array(
												'id'      => 'pcp_select_custom_field_boolean_value',
												'type'    => 'select',
												'title'   => __( 'Compare Value', 'smart-post-show-pro' ),
												'title_help' => __( 'Type compare value.', 'smart-post-show-pro' ),
												'options' => array(
													'1' => __( 'True', 'smart-post-show-pro' ),
													'0' => __( 'False', 'smart-post-show-pro' ),
												),
												'dependency' => array( 'pcp_select_custom_field_value_type|add_filter_post', '==|!=', 'BOOLEAN|true' ),
											),
											array(
												'id'    => 'add_filter_post',
												'type'  => 'checkbox',
												'title' => __( 'Add to Ajax Live Filters', 'smart-post-show-pro' ),
												'title_help' => __( 'Check to add ajax live filters.', 'smart-post-show-pro' ),
											),
											array(
												'type'    => 'subheading',
												'content' => __( 'Ajax Live Filters (Frontend)', 'smart-post-show-pro' ),
												'dependency' => array( 'add_filter_post', '==', 'true' ),
											),
											array(
												'id'     => 'ajax_filter_options',
												'type'   => 'fieldset',
												'class'  => 'ajax-live-filters',
												'title'  => __( 'Ajax Live Filters', 'smart-post-show-pro' ),
												'dependency' => array( 'add_filter_post', '==', 'true' ),
												'fields' => array(
													array(
														'id'      => 'ajax_custom_fields_filter_style',
														'class'   => 'hide-active-sign',
														'type'    => 'layout_preset',
														'title'   => __( 'Filter Type', 'smart-post-show-pro' ),
														'title_help' => __( 'Select a type for live filter.', 'smart-post-show-pro' ),
														'options' => array(
															'fl_dropdown'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/dropdown.svg',
																'text'  => __( 'Dropdown', 'smart-post-show-pro' ),
															),
															'fl_radio'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/radio.svg',
																'text'  => __( 'Radio', 'smart-post-show-pro' ),
															),
															'fl_checkbox'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/check.svg',
																'text'  => __( 'Checkbox', 'smart-post-show-pro' ),
															),
															'fl_btn'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/button.svg',
																'text'  => __( 'Button', 'smart-post-show-pro' ),
															),
															'fl_slider'  => array(
																'image' => SP_PCP_URL . 'admin/img/filter-type/ranger_slider.svg',
																'text'  => __( 'Ranger Slider (number only)', 'smart-post-show-pro' ),
															),
														),
														'default' => 'fl_btn',
													),
													array(
														'id'   => 'ajax_filter_label',
														'type' => 'text',
														'title' => __( 'Override Label', 'smart-post-show-pro' ),
														'title_help' => __( 'Type live filter label.', 'smart-post-show-pro' ),
													),
													array(
														'id'   => 'ajax_hide_empty',
														'type' => 'checkbox',
														'title' => __( 'Hide Empty Term(s)', 'smart-post-show-pro' ),
														'title_help' => __( 'Check to hide empty terms.', 'smart-post-show-pro' ),
														'dependency' => array( 'ajax_custom_fields_filter_style', '!=', 'fl_slider' ),
													),
													array(
														'id'       => 'ajax_rename_all_text',
														'type'     => 'text',
														'title'    => __( '"All" Tab Label', 'smart-post-show-pro' ),
														'title_help' => __( 'Leave it empty to hide "All" text.', 'smart-post-show-pro' ),
														'default'  => 'All',
														'dependency' => array( 'ajax_custom_fields_filter_style', 'not-any', 'fl_checkbox,fl_slider' ),
													),
													array(
														'id' => 'ajax_show_count',
														'title' => __( 'Post Counter', 'smart-post-show-pro' ),
														'title_help' => __( 'Check to show post count.', 'smart-post-show-pro' ),
														'type' => 'switcher',
														'default'  => false,
														'text_on'  => __( 'Show', 'smart-post-show-pro' ),
														'text_off' => __( 'Hide', 'smart-post-show-pro' ),
														'text_width' => 80,
														'dependency' => array( 'ajax_custom_fields_filter_style', '!=', 'fl_slider' ),
													),
													array(
														'id'       => 'pcp_filter_btn_color',
														'type'     => 'color_group',
														'title'    => __( 'Button Color', 'smart-post-show-pro' ),
														'dependency' => array( 'ajax_custom_fields_filter_style', '==', 'fl_btn' ),
														'options'  => array(
															'text_color'        => __( 'Text Color', 'smart-post-show-pro' ),
															'text_acolor'       => __( 'Text Hover', 'smart-post-show-pro' ),
															'background'        => __( 'Background', 'smart-post-show-pro' ),
															'active_background' => __( 'Active/Hover BG', 'smart-post-show-pro' ),
														),
														'default'  => array(
															'text_color'        => '#5e5e5e',
															'text_acolor'       => '#ffffff',
															'background'        => '#ffffff',
															'active_background' => '#e1624b',
														),
													),
													array(
														'id'      => 'pcp_filter_border',
														'type'    => 'border',
														'title'   => __( 'Border', 'smart-post-show-pro' ),
														'all'     => true,
														'hover_color' => true,
														'border_radius'      => true,
														'default' => array(
															'all' => '1',
															'style' => 'solid',
															'color' => '#bbbbbb',
															'hover_color' => '#e1624b',
															'border_radius' => '2',
														),
														'dependency' => array( 'ajax_custom_fields_filter_style', 'any', 'fl_dropdown,fl_btn' ),
													),
													array(
														'id'       => 'pcp_live_filter_align',
														'type'     => 'button_set',
														'title'    => __( 'Alignment', 'smart-post-show-pro' ),
														'options' => array(
															'left' => '<i class="fa fa-align-left" title="Left"></i>',
															'center' => '<i class="fa fa-align-center" title="Center"></i>',
															'right' => '<i class="fa fa-align-right" title="Right"></i>',
														),
														'default'  => 'center',
													),
												),
											),
										),
									), // Group field end.
									array(
										'id'         => 'pcp_filter_custom_field_relation',
										'type'       => 'select',
										'title'      => __( 'Relation', 'smart-post-show-pro' ),
										'class'      => 'pcp_relate_among_taxonomies',
										'options'    => array(
											'AND' => __( 'AND', 'smart-post-show-pro' ),
											'OR'  => __( 'OR', 'smart-post-show-pro' ),
										),
										'default'    => 'OR',
										'title_help' => __( 'The logical relationship between/among above custom fields.', 'smart-post-show-pro' ),
									),
								),
							),
						),
						'dependency' => array( 'pcp_advanced_filter', 'not-any', 'taxonomy,author,sortby,status,date,keyword' ),
					),
					array(
						'id'         => 'pcp_filter_by_status',
						'type'       => 'accordion',
						'class'      => 'padding-t-0 pcp-opened-accordion filter_by_style pcp-filter-by-status',
						'accordions' => array(
							array(
								'title'  => __( 'Status', 'smart-post-show-pro' ),
								'icon'   => 'fa fa-lock',
								'fields' => array(
									array(
										'id'       => 'pcp_select_post_status',
										'type'     => 'select',
										'title'    => __( 'Post Status', 'smart-post-show-pro' ),
										'options'  => 'post_statuses',
										'multiple' => true,
										'chosen'   => true,
									),
								),
							),
						),
						'dependency' => array( 'pcp_advanced_filter', 'not-any', 'taxonomy,author,custom_field,sortby,date,keyword' ),
					),
					array(
						'id'         => 'pcp_filter_by_date',
						'type'       => 'accordion',
						'class'      => 'padding-t-0 pcp-opened-accordion filter_by_style pcp-filter-by-date',
						'accordions' => array(
							array(
								'title'  => __( 'Published Date', 'smart-post-show-pro' ),
								'icon'   => 'fa fa-calendar',
								'fields' => array(
									array(
										'id'      => 'pcp_select_post_date_type',
										'type'    => 'radio',
										'class'   => 'spf_column_2',
										'options' => array(
											'yesterday'  => __( 'Yesterday', 'smart-post-show-pro' ),
											'today_only' => __( 'Today Only', 'smart-post-show-pro' ),
											'today_onwards' => __( 'Today and Onwards', 'smart-post-show-pro' ),
											'this_week'  => __( 'This Week', 'smart-post-show-pro' ),
											'this_month' => __( 'This Month', 'smart-post-show-pro' ),
											'this_year'  => __( 'This Year', 'smart-post-show-pro' ),
											'week_ago'   => __( '1 Week ago to today', 'smart-post-show-pro' ),
											'month_ago'  => __( '1 month ago to today', 'smart-post-show-pro' ),
											'three_month_ago' => __( '3 month ago to today', 'smart-post-show-pro' ),
											'year_ago'   => __( '1 year ago to today', 'smart-post-show-pro' ),
											'specific_date' => __( 'Specific Date', 'smart-post-show-pro' ),
											'specific_month' => __( 'Specific Month', 'smart-post-show-pro' ),
											'specific_year' => __( 'Specific Year', 'smart-post-show-pro' ),
											'specific_period' => __( 'Specific Period ( From & To )', 'smart-post-show-pro' ),
										),
										'default' => 'today_only',
									),
									array(
										'id'          => 'pcp_select_post_date_from_to',
										'type'        => 'date',
										'title'       => __( 'Set Period', 'smart-post-show-pro' ),
										'from_to'     => true,
										'text_from'   => __( 'From:', 'smart-post-show-pro' ),
										'text_to'     => __( 'To:', 'smart-post-show-pro' ),
										'settings'    => array(
											'dateFormat'  => 'yy-mm-dd',
											'changeMonth' => true,
											'changeYear'  => true,
										),
										'placeholder' => __( 'yy-mm-dd', 'smart-post-show-pro' ),
										'dependency'  => array( 'pcp_select_post_date_type', '==', 'specific_period' ),
									),
									array(
										'id'          => 'pcp_select_post_specific_date',
										'type'        => 'date',
										'title'       => __( 'Select Date', 'smart-post-show-pro' ),
										'settings'    => array(
											'dateFormat'  => 'yy-mm-dd',
											'changeMonth' => true,
											'changeYear'  => true,
										),
										'placeholder' => __( 'yy-mm-dd', 'smart-post-show-pro' ),
										'dependency'  => array( 'pcp_select_post_date_type', '==', 'specific_date' ),
									),
									array(
										'id'         => 'pcp_select_specific_month',
										'type'       => 'select',
										'title'      => __( 'Select Month', 'smart-post-show-pro' ),
										'options'    => array(
											'1'  => __( 'January', 'smart-post-show-pro' ),
											'2'  => __( 'February', 'smart-post-show-pro' ),
											'3'  => __( 'March', 'smart-post-show-pro' ),
											'4'  => __( 'April', 'smart-post-show-pro' ),
											'5'  => __( 'May', 'smart-post-show-pro' ),
											'6'  => __( 'June', 'smart-post-show-pro' ),
											'7'  => __( 'July', 'smart-post-show-pro' ),
											'8'  => __( 'August', 'smart-post-show-pro' ),
											'9'  => __( 'September', 'smart-post-show-pro' ),
											'10' => __( 'October', 'smart-post-show-pro' ),
											'11' => __( 'November', 'smart-post-show-pro' ),
											'12' => __( 'December', 'smart-post-show-pro' ),
										),
										'dependency' => array( 'pcp_select_post_date_type', '==', 'specific_month' ),
									),
									array(
										'id'              => 'pcp_select_post_specific_year',
										'type'            => 'spacing',
										'title'           => __( 'Set Year', 'smart-post-show-pro' ),
										'sanitize'        => 'pcp_sanitize_number_array_field',
										'all'             => true,
										'all_icon'        => false,
										'all_placeholder' => '2019',
										'show_units'      => false,
										'default'         => array(
											'all' => '2019',
										),
										'min'             => '1990',
										'dependency'      => array( 'pcp_select_post_date_type', '==', 'specific_year' ),
									),
								), // Fields.
							),
						), // Accordions.
						'dependency' => array( 'pcp_advanced_filter', 'not-any', 'taxonomy,author,custom_field,sortby,status,keyword' ),
					),
					array(
						'id'         => 'pcp_filter_by_keyword',
						'type'       => 'accordion',
						'class'      => 'padding-t-0 pcp-opened-accordion filter_by_style pcp-filter-by-keyword',
						'accordions' => array(
							array(
								'title'  => __( 'Keyword', 'smart-post-show-pro' ),
								'icon'   => 'fa fa-key',
								'fields' => array(
									array(
										'id'         => 'pcp_set_post_keyword',
										'type'       => 'text',
										'title'      => __( 'Type Keyword', 'smart-post-show-pro' ),
										'title_help' => __( 'Enter keyword(s) for searching the posts.', 'smart-post-show-pro' ),
										'options'    => 'post_statuses',
									),
									array(
										'id'         => 'add_search_filter_post',
										'class'      => 'pcp-add-search-filter-post',
										'type'       => 'checkbox',
										'title'      => __( 'Add to Ajax Live Filters', 'smart-post-show-pro' ),
										'title_help' => __( 'Check to add ajax live filter.', 'smart-post-show-pro' ),
									),
									array(
										'id'         => 'ajax_filter_options',
										'type'       => 'fieldset',
										'class'      => 'pcp_ajax_keyword',
										'title'      => __( 'Ajax Live Filters', 'smart-post-show-pro' ),
										'dependency' => array( 'add_search_filter_post', '==', 'true', true ),
										'fields'     => array(
											array(
												'id'    => 'ajax_filter_label',
												'type'  => 'text',
												'title' => __( 'Label', 'smart-post-show-pro' ),
												'title_help' => __( 'Type live filter label.', 'smart-post-show-pro' ),
											),
											array(
												'id'      => 'pcp_live_filter_align',
												'type'    => 'button_set',
												'title'   => __( 'Alignment', 'smart-post-show-pro' ),
												'options' => array(
													'left' => '<i class="fa fa-align-left" title="Left"></i>',
													'center' => '<i class="fa fa-align-center" title="Center"></i>',
													'right' => '<i class="fa fa-align-right" title="Right"></i>',
												),
												'default' => 'center',
											),
										),
									),
								),
							),
						),
						'dependency' => array( 'pcp_advanced_filter', 'not-any', 'taxonomy,author,custom_field,sortby,date,status' ),
					),
					array(
						'type'       => 'subheading',
						'class'      => 'pcp_padding_for_filter',
						'content'    => ' ',
						'dependency' => array( 'pcp_advanced_filter', 'any', 'taxonomy,author,custom_field,sortby,date,status,keyword' ),
					),
				),
			)
		); // Filter settings section end.
	}
}
