%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/plugins/fusion-builder/shortcodes/
Upload File :
Create Path :
Current File : /dom645759/wp-content/plugins/fusion-builder/shortcodes/awb-post-list.php

<?php
/**
 * Add an element to fusion-builder.
 *
 * @package fusion-builder
 * @since 3.16.2
 */
if ( fusion_is_element_enabled( 'awb_post_list' ) ) {

	if ( ! class_exists( 'FusionSC_Post_List' ) ) {
		/**
		 * Shortcode class.
		 *
		 * @package fusion-builder
		 * @since 3.16.2
		 */
		class FusionSC_Post_List extends AWB_Nav_List_Element {

			/**
			 * The shortcode name.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @var string
			 */
			protected $shortcode = 'awb_post_list';

			/**
			 * The BEM block.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @var string
			 */
			protected $block = 'awb-post-list';

			/**
			 * The secondary text next to a label is the post meta here.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @var string
			 */
			protected $meta_param = 'meta';

			/**
			 * The ceiling for a nested query.
			 *
			 * A tree needs every descendant before it can be cut down to the wanted
			 * number of top level entries, so the limit cannot go into the query. This
			 * keeps that from becoming an unbounded query on a large site.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @var int
			 */
			const NESTED_QUERY_LIMIT = 200;

			/**
			 * Gets the public post types, keyed by name.
			 *
			 * @static
			 * @access public
			 * @since 3.16.2
			 * @return array
			 */
			public static function get_element_post_types() {
				return awb_post_list_get_post_types();
			}

			/**
			 * Gets the public taxonomies, keyed by name.
			 *
			 * @static
			 * @access public
			 * @since 3.16.2
			 * @return array
			 */
			public static function get_element_taxonomies() {
				return awb_post_list_get_taxonomies();
			}

			/**
			 * Extra data handed to the live editor view.
			 *
			 * The view has to know which post types have a tree, or its preview would
			 * carry the nesting classes on a flat list.
			 *
			 * @static
			 * @access public
			 * @since 3.16.2
			 * @return array
			 */
			public static function get_element_extras() {
				$hierarchical = [];

				foreach ( self::get_element_post_types() as $post_type ) {
					if ( is_post_type_hierarchical( $post_type->name ) ) {
						$hierarchical[] = $post_type->name;
					}
				}

				return [ 'hierarchical_post_types' => $hierarchical ];
			}

			/**
			 * Gets the default values.
			 *
			 * @static
			 * @access public
			 * @since 3.16.2
			 * @return array
			 */
			public static function get_element_defaults() {
				$fusion_settings = awb_get_fusion_settings();

				$defaults = [
					// Query.
					'post_type'                     => 'post',
					'source'                        => 'recent',
					'related_by'                    => '',
					'filter_by'                     => '',
					'exclude_current'               => 'yes',
					'ignore_sticky_posts'           => 'yes',
					'hierarchical'                  => 'no',
					'max_depth'                     => '0',
					'sub_display'                   => 'always',
					'orderby'                       => 'date',
					'orderby_custom_field_name'     => '',
					'orderby_custom_field_type'     => 'CHAR',
					'order'                         => 'DESC',
					'number'                        => '5',
					'offset'                        => '0',

					// Content.
					'display_type'                  => 'list',
					'collapse_to_select'            => 'never',
					'select_label'                  => '',
					// Must stay empty. set_shortcode_defaults() swaps an empty attribute for
					// this value, so anything else here would make "no meta" unreachable.
					'meta'                          => '',
					'date_format'                   => '',
					'meta_position'                 => 'below',
					'meta_indent'                   => 'yes',
					'meta_separator'                => '',
					'show_all_link'                 => 'no',
					'all_link_text'                 => '',
					'highlight_current'             => 'yes',
					'icon'                          => '',
					'show_image'                    => 'no',
					'hover_preview'                 => 'no',

					// Design.
					'layout'                        => 'stacked',
					'inline_justify'                => 'flex-start',
					'item_align'                    => 'space-between',
					'toggle_position'               => 'edge',
					'item_gap'                      => '',
					'sub_indent'                    => '15',
					'sub_indent_style'              => 'inset',
					'sub_grouped'                   => 'no',
					'separator_style'               => 'solid',
					'separator_size'                => '1',
					'separator_color'               => '',
					'item_color'                    => '',
					'item_hover_color'              => '',
					'item_bgcolor'                  => '',
					'item_hover_bgcolor'            => '',
					'item_border_style'             => 'solid',
					'item_border_color'             => '',
					'item_hover_border_color'       => '',
					'meta_color'                    => '',
					'meta_hover_color'              => '',
					'icon_size'                     => '',
					'icon_color'                    => '',
					'icon_hover_color'              => '',
					'image_width'                   => '24',
					'image_border_radius'           => '',
					'media_gap'                     => '10',
					'hover_preview_width'           => '280',
					'hover_preview_border_radius'   => '8',
					'toggle_color'                  => '',
					'toggle_hover_color'            => '',
					'select_color'                  => $fusion_settings->get( 'form_text_color' ),
					'select_bgcolor'                => $fusion_settings->get( 'form_bg_color' ),
					'select_border_color'           => $fusion_settings->get( 'form_border_color' ),
					'select_focus_border_color'     => $fusion_settings->get( 'form_focus_border_color' ),
					'select_border_radius'          => $fusion_settings->get( 'form_border_radius' ),
					'select_height'                 => $fusion_settings->get( 'form_input_height' ),

					// Typography.
					'fusion_font_family_item_font'  => '',
					'fusion_font_variant_item_font' => '',
					'item_font_size'                => '',
					'item_line_height'              => '',
					'item_letter_spacing'           => '',
					'item_text_transform'           => '',
					'fusion_font_family_meta_font'  => '',
					'fusion_font_variant_meta_font' => '',
					'meta_font_size'                => '',
					'meta_line_height'              => '',
					'meta_letter_spacing'           => '',
					'meta_text_transform'           => '',

					// Item padding.
					'item_padding_top'              => '',
					'item_padding_right'            => '',
					'item_padding_bottom'           => '',
					'item_padding_left'             => '',

					// Item border.
					'item_border_top'               => '',
					'item_border_right'             => '',
					'item_border_bottom'            => '',
					'item_border_left'              => '',

					// Border radius.
					'border_radius_top_left'        => '',
					'border_radius_top_right'       => '',
					'border_radius_bottom_right'    => '',
					'border_radius_bottom_left'     => '',

					// Size.
					'max_width'                     => '',
					'max_width_medium'              => '',
					'max_width_small'               => '',

					// Margin.
					'margin_top'                    => '',
					'margin_right'                  => '',
					'margin_bottom'                 => '',
					'margin_left'                   => '',
					'margin_top_medium'             => '',
					'margin_right_medium'           => '',
					'margin_bottom_medium'          => '',
					'margin_left_medium'            => '',
					'margin_top_small'              => '',
					'margin_right_small'            => '',
					'margin_bottom_small'           => '',
					'margin_left_small'             => '',

					// CSS.
					'class'                         => '',
					'id'                            => '',

					// Animation.
					'animation_direction'           => 'left',
					'animation_offset'              => awb_get_fusion_settings()->get( 'animation_offset' ),
					'animation_speed'               => '',
					'animation_delay'               => '',
					'animation_type'                => '',
					'animation_color'               => '',

					// Visibility.
					'hide_on_mobile'                => fusion_builder_default_visibility( 'string' ),
				];

				// Per taxonomy term selection params.
				foreach ( self::get_element_taxonomies() as $taxonomy ) {
					$defaults[ 'include_' . $taxonomy->name ] = '';
					$defaults[ 'exclude_' . $taxonomy->name ] = '';
				}

				// Parent selection, one per hierarchical post type.
				foreach ( self::get_element_post_types() as $post_type ) {
					if ( is_post_type_hierarchical( $post_type->name ) ) {
						$defaults[ 'parent_post_' . $post_type->name ] = '';
					}
				}

				return $defaults;
			}

			/**
			 * Resolves the element specific args.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return void
			 */
			protected function set_element_args() {

				// Nesting is only offered for post types that have a tree to begin with, and
				// the guard has to run in PHP too: the dependency only hides the fields.
				if ( ! is_post_type_hierarchical( $this->args['post_type'] ) ) {
					$this->args['hierarchical'] = 'no';
				}
			}

			/**
			 * The meta line sits under the label by default, which needs a class.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return string
			 */
			protected function get_extra_classes() {
				$classes = '';

				if ( $this->has_hover_preview() ) {
					$classes .= ' ' . $this->block . '--hover-preview';
				}

				if ( empty( $this->get_meta_parts() ) ) {
					return $classes;
				}

				$classes .= ' ' . $this->block . '--meta-' . $this->args['meta_position'];

				if ( $this->is_meta_indented() ) {
					$classes .= ' ' . $this->block . '--meta-indented';
				}

				return $classes;
			}

			/**
			 * Adds the hover preview vars to the shared ones.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return string
			 */
			protected function get_style_variables() {
				$styles = parent::get_style_variables();

				if ( $this->has_hover_preview() ) {
					$styles .= $this->get_css_vars_for_options(
						[
							'hover_preview_width'         => [ 'callback' => [ 'Fusion_Sanitize', 'get_value_with_unit' ] ],
							'hover_preview_border_radius' => [ 'callback' => [ 'Fusion_Sanitize', 'get_value_with_unit' ] ],
						]
					);
				}

				return $styles;
			}

			/**
			 * Whether the featured image follows the cursor while a post is hovered.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return bool
			 */
			protected function has_hover_preview() {
				return 'yes' === $this->args['hover_preview'] && 'list' === $this->args['display_type'];
			}

			/**
			 * The hover preview image travels on the link, the script reads it from there.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @param array $item The item.
			 * @return string
			 */
			protected function get_link_extra_attributes( $item ) {
				if ( empty( $item['preview'] ) ) {
					return '';
				}

				return ' data-awb-preview="' . esc_url( $item['preview'] ) . '"';
			}

			/**
			 * Whether the meta lines up under the title instead of the row edge.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return bool
			 */
			protected function is_meta_indented() {
				return 'below' === $this->args['meta_position'] && 'yes' === $this->args['meta_indent'];
			}

			/**
			 * The meta parts to render, in the order they were picked.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return array
			 */
			protected function get_meta_parts() {
				$picked = array_filter( array_map( 'trim', explode( ',', $this->args['meta'] ) ) );

				// array_intersect keeps the order of its first argument, which is the order
				// the items were dragged into.
				return array_values( array_intersect( $picked, [ 'date', 'author', 'views' ] ) );
			}

			/**
			 * Groups the label and its meta when the meta sits below the title.
			 *
			 * Sharing a box with the label is what lets the meta line up under the title
			 * rather than under a leading icon or image, and it keeps working on items
			 * that happen to have no image of their own.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @param array $item The item.
			 * @return string
			 */
			protected function get_link_inner_html( $item ) {
				if ( ! $this->is_meta_indented() || '' === $item['meta'] ) {
					return parent::get_link_inner_html( $item );
				}

				$media = $this->get_icon_html() . $this->get_image_html( $item );

				$html  = '<span class="' . $this->block . '__text">';
				$html .= '<span class="' . $this->block . '__body">';

				// Grouping the media keeps the grid at exactly one leading cell however many
				// pieces an item carries, which is what lets it sit in the title row rather
				// than beside the whole two line box.
				if ( '' !== $media ) {
					$html .= '<span class="' . $this->block . '__media-group">' . $media . '</span>';
				}

				$html .= '<span class="' . $this->block . '__label">' . esc_html( $item['label'] ) . '</span>';
				$html .= '<span class="' . $this->block . '__meta">' . esc_html( $item['meta'] ) . '</span>';
				$html .= '</span>';
				$html .= '</span>';

				return $html;
			}

			/**
			 * Normalizes the queried posts into the shape the base class renders.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return array
			 */
			protected function get_items() {
				$show_image    = 'yes' === $this->args['show_image'];
				$hover_preview = $this->has_hover_preview();
				$items         = [];

				foreach ( $this->query_posts() as $post ) {
					$items[] = [
						'id'      => (int) $post->ID,
						'parent'  => (int) $post->post_parent,
						'label'   => $this->get_post_label( $post ),
						'url'     => (string) get_permalink( $post ),
						'meta'    => $this->get_post_meta_text( $post ),
						'image'   => $show_image ? $this->get_post_image( $post ) : null,
						'preview' => $hover_preview ? $this->get_post_preview_url( $post ) : '',
						'object'  => $post,
					];
				}

				// A scoped nested query cannot be done in SQL, so the subtree is cut out here.
				// build_tree() treats items whose parent is missing as roots, so the result
				// still renders from its own top level.
				$scope = $this->get_scope_parent_id();

				if ( null !== $scope ) {
					$items = $this->filter_descendants( $items, $scope );
				}

				return $items;
			}

			/**
			 * The placeholder copy for an empty query.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return string
			 */
			protected function get_empty_message() {
				return __( 'No posts found. Try another post type or query.', 'fusion-builder' );
			}

			/**
			 * The default label of the empty first select option.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return string
			 */
			protected function get_select_default_label() {
				return __( 'Select a post', 'fusion-builder' );
			}

			/**
			 * Queries the posts based on the source args.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return array
			 */
			protected function query_posts() {
				$post_type = $this->args['post_type'];

				if ( ! awb_is_listable_post_type( $post_type ) ) {
					return [];
				}

				$nested = 'yes' === $this->args['hierarchical'];
				$number = (int) $this->args['number'];

				$query_args = [
					'post_type'              => $post_type,
					'post_status'            => 'publish',
					'ignore_sticky_posts'    => 'yes' === $this->args['ignore_sticky_posts'],
					'orderby'                => $this->args['orderby'],
					'order'                  => $this->args['order'],
					'offset'                 => max( 0, (int) $this->args['offset'] ),
					'posts_per_page'         => $nested ? self::NESTED_QUERY_LIMIT : ( 0 < $number ? $number : -1 ),
					'no_found_rows'          => true,
					'update_post_term_cache' => false,
					'update_post_meta_cache' => 'yes' === $this->args['show_image'] || $this->has_hover_preview() || in_array( 'views', $this->get_meta_parts(), true ),
				];

				if ( 'menu_order' === $this->args['orderby'] ) {
					$query_args['orderby'] = 'menu_order title';
				} elseif ( 'post_views' === $this->args['orderby'] ) {

					// The counter is only written once a post has actually been visited, so
					// posts that were never viewed have no meta row and drop out of the list
					// rather than sorting to the end. That matches Post Cards.
					$query_args['orderby']  = 'meta_value_num';
					$query_args['meta_key'] = 'avada_post_views_count'; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key
				} elseif ( 'meta_value' === $this->args['orderby'] ) {
					$field = trim( $this->args['orderby_custom_field_name'] );

					// Ordering by an unnamed field would sort on every meta row there is, so
					// the list falls back to its default order until a field is given.
					if ( '' === $field ) {
						$query_args['orderby'] = 'date';
					} else {
						$query_args['meta_key']  = $field; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key
						$query_args['meta_type'] = $this->args['orderby_custom_field_type'];
					}
				}

				$exclude = $this->get_excluded_post_ids();

				if ( ! empty( $exclude ) ) {
					$query_args['post__not_in'] = $exclude;
				}

				$tax_query = $this->get_tax_query();

				if ( ! empty( $tax_query ) ) {
					$query_args['tax_query'] = $tax_query; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query
				}

				// A flat list can be scoped in SQL. A nested one is cut down after the query,
				// because the whole subtree has to be present before the tree is built.
				$scope = $this->get_scope_parent_id();

				if ( null !== $scope && ! $nested ) {
					$query_args['post_parent'] = $scope;
				}

				$query_args = apply_filters( 'awb_post_list_query_args', $query_args, $this->args );

				$query = new WP_Query( $query_args );

				return $query->posts;
			}

			/**
			 * Gets the parent the query is scoped to, if any.
			 *
			 * Null means the query is not scoped, which is not the same as a scope of 0:
			 * that is the top level, and what "children of current" falls back to when the
			 * page is not a post of the chosen type.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return int|null
			 */
			protected function get_scope_parent_id() {
				if ( ! is_post_type_hierarchical( $this->args['post_type'] ) ) {
					return null;
				}

				switch ( $this->args['source'] ) {
					case 'children_of_current':
						return $this->get_queried_post_id();

					case 'children_of_parent':
						return $this->get_selected_parent_id();
				}

				return null;
			}

			/**
			 * Reduces a flat list to the descendants of a parent.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @param array $items  The flat list of items.
			 * @param int   $parent The parent ID.
			 * @return array
			 */
			protected function filter_descendants( $items, $parent ) {
				$by_parent = [];

				foreach ( $items as $item ) {
					$by_parent[ $item['parent'] ][] = $item;
				}

				$descendants = [];
				$stack       = [ $parent ];

				while ( ! empty( $stack ) ) {
					$current = array_pop( $stack );

					if ( empty( $by_parent[ $current ] ) ) {
						continue;
					}

					foreach ( $by_parent[ $current ] as $child ) {
						$descendants[] = $child;
						$stack[]       = $child['id'];
					}

					// A malformed tree could point back at itself, so a branch is only walked once.
					unset( $by_parent[ $current ] );
				}

				return $descendants;
			}

			/**
			 * Gets the post IDs to keep out of the query.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return array
			 */
			protected function get_excluded_post_ids() {
				if ( 'yes' !== $this->args['exclude_current'] || ! is_singular() ) {
					return [];
				}

				$current = (int) get_queried_object_id();

				return $current ? [ $current ] : [];
			}

			/**
			 * Builds the tax query out of the term params and the source.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return array
			 */
			protected function get_tax_query() {
				$tax_query = [];
				$filter_by = $this->args['filter_by'];

				// One taxonomy at a time, the same way Post Cards filters. A field per
				// taxonomy per post type would be needed otherwise, since a taxonomy can
				// belong to several post types and a dependency only holds one value.
				if ( '' !== $filter_by && taxonomy_exists( $filter_by ) ) {
					foreach ( [ 'include' => 'IN', 'exclude' => 'NOT IN' ] as $key => $operator ) {
						$terms = $this->get_term_ids( $key . '_' . $filter_by );

						if ( empty( $terms ) ) {
							continue;
						}

						$tax_query[] = [
							'taxonomy' => $filter_by,
							'field'    => 'term_id',
							'terms'    => $terms,
							'operator' => $operator,
						];
					}
				}

				if ( 'related' === $this->args['source'] ) {
					$related = $this->get_related_clause();

					if ( ! empty( $related ) ) {
						$tax_query[] = $related;
					}
				}

				if ( 1 < count( $tax_query ) ) {
					$tax_query['relation'] = 'AND';
				}

				return $tax_query;
			}

			/**
			 * Gets the term IDs stored in a param.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @param string $key The param name.
			 * @return array
			 */
			protected function get_term_ids( $key ) {
				if ( ! isset( $this->args[ $key ] ) || '' === $this->args[ $key ] ) {
					return [];
				}

				return array_values( array_filter( array_map( 'absint', explode( ',', $this->args[ $key ] ) ) ) );
			}

			/**
			 * Builds the tax query clause that makes a post related to the current one.
			 *
			 * Falls back to nothing, which leaves the list as the plain recent list, when
			 * the page has no terms to relate to -- the builder's ajax render included.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return array
			 */
			protected function get_related_clause() {
				$taxonomies = self::get_element_taxonomies();
				$taxonomy   = $this->args['related_by'];

				if ( '' === $taxonomy || ! isset( $taxonomies[ $taxonomy ] ) ) {
					$taxonomy = $this->get_post_type_taxonomy( $this->args['post_type'], $taxonomies );
				}

				if ( '' === $taxonomy ) {
					return [];
				}

				$queried = get_queried_object();
				$terms   = [];

				if ( $queried instanceof WP_Term && $queried->taxonomy === $taxonomy ) {
					$terms = [ (int) $queried->term_id ];
				} elseif ( is_singular() ) {
					$assigned = get_the_terms( get_queried_object_id(), $taxonomy );

					if ( ! is_wp_error( $assigned ) && ! empty( $assigned ) ) {
						$terms = wp_list_pluck( $assigned, 'term_id' );
					}
				}

				if ( empty( $terms ) ) {
					return [];
				}

				return [
					'taxonomy' => $taxonomy,
					'field'    => 'term_id',
					'terms'    => array_map( 'absint', $terms ),
				];
			}

			/**
			 * Gets the ID of the queried post, if it is of the chosen post type.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return int
			 */
			protected function get_queried_post_id() {
				if ( ! is_singular( $this->args['post_type'] ) ) {
					return 0;
				}

				return (int) get_queried_object_id();
			}

			/**
			 * Gets the ID of the parent post selected in the options.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return int
			 */
			protected function get_selected_parent_id() {
				$key = 'parent_post_' . $this->args['post_type'];

				if ( ! isset( $this->args[ $key ] ) || '' === $this->args[ $key ] ) {
					return 0;
				}

				// The ajax select can hold multiple values, only the first one is used.
				$values = explode( ',', $this->args[ $key ] );

				return absint( $values[0] );
			}

			/**
			 * Gets the post IDs that should be marked as current.
			 *
			 * Only the post itself. The base class walks the tree to find the ancestors,
			 * which is what opens the branch the visitor is in.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return array
			 */
			protected function get_current_item_ids() {
				$current = $this->get_queried_post_id();

				if ( ! $current ) {
					return [];
				}

				return [ $current ];
			}

			/**
			 * Gets the label of a post, falling back to its ID when it has no title.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @param WP_Post $post The post object.
			 * @return string
			 */
			protected function get_post_label( $post ) {
				$title = get_the_title( $post );

				if ( '' !== trim( wp_strip_all_tags( $title ) ) ) {
					return $title;
				}

				/* translators: The post ID. */
				return sprintf( __( '(no title) #%d', 'fusion-builder' ), (int) $post->ID );
			}

			/**
			 * Builds the meta text shown next to or under a post title.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @param WP_Post $post The post object.
			 * @return string
			 */
			protected function get_post_meta_text( $post ) {
				$parts = [];

				foreach ( $this->get_meta_parts() as $part ) {
					switch ( $part ) {
						case 'date':
							$format = '' !== $this->args['date_format'] ? $this->args['date_format'] : $this->get_default_date_format();
							$date   = get_the_date( $format, $post );

							if ( $date ) {
								$parts[] = $date;
							}
							break;

						case 'author':
							$author = get_the_author_meta( 'display_name', $post->post_author );

							if ( '' !== $author ) {
								$parts[] = $author;
							}
							break;

						case 'views':

							// The counter lives in the theme, so the item is simply left out
							// when the builder runs without it.
							if ( ! class_exists( 'AWB_View_Count' ) ) {
								break;
							}

							$views   = AWB_View_Count::get_post_views( $post );
							$parts[] = sprintf( /* translators: %s: number of views. */ _n( '%s View', '%s Views', $views, 'fusion-builder' ), number_format_i18n( $views ) );
							break;
					}
				}

				if ( empty( $parts ) ) {
					return '';
				}

				$separator = '' !== $this->args['meta_separator'] ? $this->args['meta_separator'] : 'ยท';

				return implode( ' ' . $separator . ' ', $parts );
			}

			/**
			 * The date format to use when the element does not set its own.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return string
			 */
			protected function get_default_date_format() {
				$format = function_exists( 'fusion_library' ) ? fusion_library()->get_option( 'date_format' ) : '';

				return $format ? $format : get_option( 'date_format' );
			}

			/**
			 * Gets the attachment ID and size of the post image.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @param WP_Post $post The post object.
			 * @return array An array with the 'id' and 'size' keys.
			 */
			protected function get_post_image( $post ) {
				$image = [
					'id'   => (int) get_post_thumbnail_id( $post ),
					'size' => 'medium',
				];

				return apply_filters( 'awb_post_list_post_image', $image, $post, $this->args );
			}

			/**
			 * Gets the URL of the hover preview image of a post.
			 *
			 * The large size stays sharp up to the maximum preview width on high density screens.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @param WP_Post $post The post object.
			 * @return string
			 */
			protected function get_post_preview_url( $post ) {
				$url = get_the_post_thumbnail_url( $post, 'large' );

				return (string) apply_filters( 'awb_post_list_hover_preview_url', $url ? $url : '', $post, $this->args );
			}

			/**
			 * Gets the URL used for the "all posts" item.
			 *
			 * @access protected
			 * @since 3.16.2
			 * @return string
			 */
			protected function get_all_link_url() {
				$url = '';

				if ( 'post' === $this->args['post_type'] ) {
					$posts_page = (int) get_option( 'page_for_posts' );
					$url        = $posts_page ? get_permalink( $posts_page ) : '';
				} else {
					$archive = get_post_type_archive_link( $this->args['post_type'] );
					$url     = $archive ? $archive : '';
				}

				if ( ! $url ) {
					$url = home_url( '/' );
				}

				return apply_filters( 'awb_post_list_all_link_url', $url, $this->args );
			}
		}
	}

	new FusionSC_Post_List();
}

if ( ! function_exists( 'awb_post_list_get_post_types' ) ) {
	/**
	 * Gets the public post types the element can use, keyed by name.
	 *
	 * Outside the enabled check, because the map below is registered while the
	 * element is disabled too -- that is what keeps it listed in Builder Options
	 * -- and the class it would otherwise call only exists when enabled.
	 *
	 * @since 3.16.2
	 * @return array
	 */
	function awb_post_list_get_post_types() {
		$post_types = get_post_types(
			[
				'public'  => true,
				'show_ui' => true,
			],
			'objects'
		);

		unset( $post_types['attachment'] );

		return apply_filters( 'awb_post_list_post_types', $post_types );
	}
}

if ( ! function_exists( 'awb_post_list_get_taxonomies' ) ) {
	/**
	 * Gets the public taxonomies the element can filter by, keyed by name.
	 *
	 * @since 3.16.2
	 * @return array
	 */
	function awb_post_list_get_taxonomies() {
		$taxonomies = get_taxonomies(
			[
				'public'  => true,
				'show_ui' => true,
			],
			'objects'
		);

		unset( $taxonomies['link_category'], $taxonomies['post_format'] );

		return apply_filters( 'awb_post_list_taxonomies', $taxonomies );
	}
}

/**
 * Map shortcode to Avada Builder.
 *
 * @since 3.16.2
 * @return void
 */
function awb_post_list_element() {
	$post_types      = awb_post_list_get_post_types();
	$taxonomies      = awb_post_list_get_taxonomies();
	$fusion_settings = awb_get_fusion_settings();
	$ajax_render     = [
		'function' => 'fusion_ajax',
		'action'   => 'get_awb_post_list',
		'ajax'     => true,
	];

	$orderby_choices = [
		'date'          => esc_attr__( 'Date', 'fusion-builder' ),
		'modified'      => esc_attr__( 'Last Modified', 'fusion-builder' ),
		'title'         => esc_attr__( 'Title', 'fusion-builder' ),
		'name'          => esc_attr__( 'Slug', 'fusion-builder' ),
		'author'        => esc_attr__( 'Author', 'fusion-builder' ),
		'ID'            => esc_attr__( 'ID', 'fusion-builder' ),
		'menu_order'    => esc_attr__( 'Menu Order', 'fusion-builder' ),
		'comment_count' => esc_attr__( 'Comment Count', 'fusion-builder' ),
		'post_views'    => esc_attr__( 'Post Views', 'fusion-builder' ),
	];

	// The Events Calendar sorts on its own occurrence table, so the choice is only
	// offered while it can actually do something with it.
	if ( class_exists( 'Tribe__Events__Main' ) ) {
		$orderby_choices['event_date'] = esc_attr__( 'Event Date', 'fusion-builder' );
	}

	$orderby_choices['meta_value'] = esc_attr__( 'Custom Field', 'fusion-builder' ); // phpcs:ignore WordPress.DB.SlowDBQuery
	$orderby_choices['rand']       = esc_attr__( 'Random', 'fusion-builder' );

	// The select options are pointless unless a select is actually rendered, which
	// happens either as the display type or as the responsive collapse of a list.
	$select_shown = [
		[
			'or'         => true,
			'conditions' => [
				[
					'element'  => 'display_type',
					'value'    => 'select',
					'operator' => '==',
				],
				[
					'element'  => 'collapse_to_select',
					'value'    => 'never',
					'operator' => '!=',
				],
			],
		],
	];

	// Any picked meta item brings the meta into the markup, so the options that style
	// it only need the sortable to be non-empty.
	$meta_shown_in_list = [
		[
			'element'  => 'meta',
			'value'    => '',
			'operator' => '!=',
		],
		[
			'element'  => 'display_type',
			'value'    => 'list',
			'operator' => '==',
		],
	];

	$post_type_options = [];
	$tax_options       = [ '' => esc_attr__( 'Automatic', 'fusion-builder' ) ];
	$filter_options    = [ '' => esc_attr__( 'No Filter', 'fusion-builder' ) ];

	foreach ( $post_types as $post_type ) {
		$post_type_options[ $post_type->name ] = $post_type->labels->name;
	}

	foreach ( $taxonomies as $taxonomy ) {
		$tax_options[ $taxonomy->name ]    = $taxonomy->labels->name;
		$filter_options[ $taxonomy->name ] = $taxonomy->labels->name;
	}

	// Parent selection, one field per hierarchical post type. A post type cannot be
	// searched without knowing which one it is, and a dependency only takes one value.
	$parent_params = [];

	foreach ( $post_types as $post_type ) {
		if ( ! is_post_type_hierarchical( $post_type->name ) ) {
			continue;
		}

		$field_type  = 'ajax_select';
		$ajax        = 'fusion_search_query';
		$ajax_params = [
			'post_type' => $post_type,
		];
		$selection   = [];

		$counts = wp_count_posts( $post_type->name );

		if ( 25 > (int) $counts->publish ) {
			$ajax       = '';
			$field_type = 'select';
			$posts      = get_posts(
				[
					'post_type'      => $post_type->name,
					'posts_per_page' => -1, // phpcs:ignore WPThemeReview.CoreFunctionality.PostsPerPage
					'orderby'        => 'title',
					'order'          => 'ASC',
				]
			);

			foreach ( $posts as $single ) {
				$selection[ $single->ID ] = get_the_title( $single );
			}
		}

		$parent_params[] = [
			'type'        => $field_type,
			/* translators: Post type singular name. */
			'heading'     => sprintf( esc_attr__( 'Parent %s', 'fusion-builder' ), ucwords( $post_type->labels->singular_name ) ),
			'description' => esc_attr__( 'Select the post whose children should be displayed.', 'fusion-builder' ),
			'placeholder' => ucwords( $post_type->labels->singular_name ),
			'param_name'  => 'parent_post_' . $post_type->name,
			'default'     => '',
			'value'       => $selection,
			'ajax'        => $ajax,
			'ajax_params' => $ajax_params,
			'callback'    => $ajax_render,
			'dependency'  => [
				[
					'element'  => 'post_type',
					'value'    => $post_type->name,
					'operator' => '==',
				],
				[
					'element'  => 'source',
					'value'    => 'children_of_parent',
					'operator' => '==',
				],
			],
		];
	}

	// Term selection, one set per taxonomy, shown for the taxonomy chosen to filter by.
	// A taxonomy can belong to several post types, so it cannot hang off the post type.
	$term_params = [];

	foreach ( $taxonomies as $taxonomy ) {
		$field_type  = 'ajax_select';
		$ajax        = 'fusion_search_query';
		$ajax_params = [ 'taxonomy' => $taxonomy->name ];
		$selection   = [];

		if ( 25 > wp_count_terms( $taxonomy->name ) ) {
			$ajax       = '';
			$field_type = 'multiple_select';
			$terms      = get_terms(
				[
					'taxonomy'   => $taxonomy->name,
					'hide_empty' => false,
				]
			);

			if ( ! is_wp_error( $terms ) ) {
				foreach ( $terms as $term ) {
					$selection[ $term->term_id ] = $term->name;
				}
			}
		}

		$taxonomy_title = ucwords( $taxonomy->labels->name );

		foreach ( [ 'include', 'exclude' ] as $mode ) {
			$term_params[] = [
				'type'        => $field_type,
				'heading'     => 'include' === $mode
					/* translators: Taxonomy title. */
					? sprintf( esc_attr__( 'Include %s', 'fusion-builder' ), $taxonomy_title )
					/* translators: Taxonomy title. */
					: sprintf( esc_attr__( 'Exclude %s', 'fusion-builder' ), $taxonomy_title ),
				'description' => 'include' === $mode
					/* translators: Taxonomy name. */
					? sprintf( esc_attr__( 'Select the %s to pull posts from. Leave empty for all.', 'fusion-builder' ), strtolower( $taxonomy->labels->name ) )
					/* translators: Taxonomy name. */
					: sprintf( esc_attr__( 'Select the %s whose posts should not be displayed.', 'fusion-builder' ), strtolower( $taxonomy->labels->name ) ),
				'placeholder' => $taxonomy_title,
				'param_name'  => $mode . '_' . $taxonomy->name,
				'default'     => '',
				'value'       => $selection,
				'ajax'        => $ajax,
				'ajax_params' => $ajax_params,
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'filter_by',
						'value'    => $taxonomy->name,
						'operator' => '==',
					],
				],
			];
		}
	}

	$params = [
		[
			'type'        => 'select',
			'heading'     => esc_attr__( 'Post Type', 'fusion-builder' ),
			'description' => esc_attr__( 'Select the post type to pull the entries from.', 'fusion-builder' ),
			'param_name'  => 'post_type',
			'default'     => 'post',
			'value'       => $post_type_options,
			'callback'    => $ajax_render,
		],
		[
			'type'        => 'select',
			'heading'     => esc_attr__( 'Posts To Display', 'fusion-builder' ),
			'description' => esc_attr__( 'Choose which posts should be pulled in. "Related To Current" uses the terms of the post or archive being viewed and falls back to the latest posts elsewhere, the builder preview included. The two child options only apply to hierarchical post types such as pages, and fall back to the top level when there is no parent to go by.', 'fusion-builder' ),
			'param_name'  => 'source',
			'default'     => 'recent',
			'value'       => [
				'recent'              => esc_attr__( 'Latest Posts', 'fusion-builder' ),
				'related'             => esc_attr__( 'Related To Current', 'fusion-builder' ),
				'children_of_current' => esc_attr__( 'Children Of Current Post', 'fusion-builder' ),
				'children_of_parent'  => esc_attr__( 'Children Of Selected Post', 'fusion-builder' ),
			],
			'callback'    => $ajax_render,
		],
		[
			'type'        => 'select',
			'heading'     => esc_attr__( 'Related By', 'fusion-builder' ),
			'description' => esc_attr__( 'Choose the taxonomy that decides which posts count as related. "Automatic" uses the main taxonomy of the post type, which is the categories where there are any.', 'fusion-builder' ),
			'param_name'  => 'related_by',
			'default'     => '',
			'value'       => $tax_options,
			'callback'    => $ajax_render,
			'dependency'  => [
				[
					'element'  => 'source',
					'value'    => 'related',
					'operator' => '==',
				],
			],
		],
	];

	$params = array_merge( $params, $parent_params );

	$params = array_merge(
		$params,
		[
			[
				'type'        => 'select',
				'heading'     => esc_attr__( 'Filter By', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose a taxonomy to narrow the posts down by. The fields to pick the terms appear once one is chosen.', 'fusion-builder' ),
				'param_name'  => 'filter_by',
				'default'     => '',
				'value'       => $filter_options,
				'callback'    => $ajax_render,
			],
		]
	);

	$params = array_merge( $params, $term_params );

	$params = array_merge(
		$params,
		[
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Exclude Current Post', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to leave the post being viewed out of the list.', 'fusion-builder' ),
				'param_name'  => 'exclude_current',
				'default'     => 'yes',
				'value'       => [
					'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
					'no'  => esc_attr__( 'No', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Ignore Sticky Posts', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to treat sticky posts like any other, instead of pulling them to the top of the list.', 'fusion-builder' ),
				'param_name'  => 'ignore_sticky_posts',
				'default'     => 'yes',
				'value'       => [
					'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
					'no'  => esc_attr__( 'No', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'post_type',
						'value'    => 'post',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'select',
				'heading'     => esc_attr__( 'Order By', 'fusion-builder' ),
				'description' => esc_attr__( 'Defines how the posts should be ordered. "Post Views" needs the post views counter to be turned on in Global Options > Extras, and only lists posts that have been viewed at least once.', 'fusion-builder' ),
				'param_name'  => 'orderby',
				'default'     => 'date',
				'value'       => $orderby_choices,
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'Custom Field Name', 'fusion-builder' ),
				'description' => esc_attr__( 'Insert the name of the custom field to order by. Posts without that field are not listed.', 'fusion-builder' ),
				'param_name'  => 'orderby_custom_field_name',
				'value'       => '',
				'dependency'  => [
					[
						'element'  => 'orderby',
						'value'    => 'meta_value',
						'operator' => '==',
					],
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'select',
				'heading'     => esc_attr__( 'Custom Field Type', 'fusion-builder' ),
				'description' => esc_attr__( 'Select the value type of the custom field, so it is sorted correctly.', 'fusion-builder' ),
				'param_name'  => 'orderby_custom_field_type',
				'default'     => 'CHAR',
				'value'       => [
					'CHAR'     => esc_attr__( 'String', 'fusion-builder' ),
					'NUMERIC'  => esc_attr__( 'Numeric', 'fusion-builder' ),
					'DATE'     => esc_attr__( 'Date', 'fusion-builder' ),
					'DATETIME' => esc_attr__( 'Date And Time', 'fusion-builder' ),
					'TIME'     => esc_attr__( 'Time', 'fusion-builder' ),
					'BINARY'   => esc_attr__( 'Binary', 'fusion-builder' ),
					'DECIMAL'  => esc_attr__( 'Decimal', 'fusion-builder' ),
				],
				'dependency'  => [
					[
						'element'  => 'orderby',
						'value'    => 'meta_value',
						'operator' => '==',
					],
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Order', 'fusion-builder' ),
				'description' => esc_attr__( 'Defines the sorting order of the posts.', 'fusion-builder' ),
				'param_name'  => 'order',
				'default'     => 'DESC',
				'value'       => [
					'ASC'  => esc_attr__( 'Ascending', 'fusion-builder' ),
					'DESC' => esc_attr__( 'Descending', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Number Of Posts', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the maximum number of top level posts to display. Set to 0 to display all.', 'fusion-builder' ),
				'param_name'  => 'number',
				'value'       => '5',
				'min'         => '0',
				'max'         => '50',
				'step'        => '1',
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Offset', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the number of posts to skip before the list starts.', 'fusion-builder' ),
				'param_name'  => 'offset',
				'value'       => '0',
				'min'         => '0',
				'max'         => '50',
				'step'        => '1',
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Display Type', 'fusion-builder' ),
				'description' => esc_attr__( 'Select how the posts should be displayed. The select navigates to the selected post.', 'fusion-builder' ),
				'param_name'  => 'display_type',
				'default'     => 'list',
				'value'       => [
					'list'   => esc_attr__( 'List', 'fusion-builder' ),
					'select' => esc_attr__( 'Select', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'select',
				'heading'     => esc_attr__( 'Collapse To Select On', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to replace the list with a select on smaller screens. This keeps long lists usable on mobile. Both are output and swapped at the breakpoint, so the posts are in the markup twice.', 'fusion-builder' ),
				'param_name'  => 'collapse_to_select',
				'default'     => 'never',
				'value'       => [
					'never'  => esc_attr__( 'Never', 'fusion-builder' ),
					'medium' => esc_attr__( 'Medium Screens', 'fusion-builder' ),
					'small'  => esc_attr__( 'Small Screens', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'Select Label', 'fusion-builder' ),
				'description' => esc_attr__( 'The text of the first, empty select option. Leave empty for the default.', 'fusion-builder' ),
				'param_name'  => 'select_label',
				'value'       => '',
				'callback'    => $ajax_render,
				'dependency'  => $select_shown,
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Layout', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose a stacked list or an inline, wrapping row of posts. The inline layout is always flat.', 'fusion-builder' ),
				'param_name'  => 'layout',
				'default'     => 'stacked',
				'value'       => [
					'stacked' => esc_attr__( 'Stacked', 'fusion-builder' ),
					'inline'  => esc_attr__( 'Inline', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Nest Child Posts', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to display child posts nested below their parent. Only applies to hierarchical post types such as pages, and is ignored for the others. Not available for the inline layout.', 'fusion-builder' ),
				'param_name'  => 'hierarchical',
				'default'     => 'no',
				'value'       => [
					'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
					'no'  => esc_attr__( 'No', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'select',
				'heading'     => esc_attr__( 'Child Posts Display', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose how nested child posts behave. "Current Branch Only" shows the children of the post being viewed, "Accordion" adds a toggle to each parent.', 'fusion-builder' ),
				'param_name'  => 'sub_display',
				'default'     => 'always',
				'value'       => [
					'always'    => esc_attr__( 'Always Expanded', 'fusion-builder' ),
					'current'   => esc_attr__( 'Current Branch Only', 'fusion-builder' ),
					'accordion' => esc_attr__( 'Accordion', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'hierarchical',
						'value'    => 'yes',
						'operator' => '==',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Maximum Depth', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the maximum number of levels to display. Set to 0 for unlimited.', 'fusion-builder' ),
				'param_name'  => 'max_depth',
				'value'       => '0',
				'min'         => '0',
				'max'         => '6',
				'step'        => '1',
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'hierarchical',
						'value'    => 'yes',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'iconpicker',
				'heading'     => esc_attr__( 'Icon', 'fusion-builder' ),
				'description' => esc_attr__( 'Select the icon that should be displayed in front of every post title. Leave empty for no icon.', 'fusion-builder' ),
				'param_name'  => 'icon',
				'value'       => '',
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Show Featured Image', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to display the featured image of each post. The image is displayed after the icon, so both can be used together.', 'fusion-builder' ),
				'param_name'  => 'show_image',
				'default'     => 'no',
				'value'       => [
					'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
					'no'  => esc_attr__( 'No', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Hover Image Preview', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to show the featured image of a post next to the cursor while the post is hovered. Works independently of the featured image in the list, and only on devices with a mouse.', 'fusion-builder' ),
				'param_name'  => 'hover_preview',
				'default'     => 'no',
				'value'       => [
					'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
					'no'  => esc_attr__( 'No', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'connected_sortable',
				'heading'     => esc_attr__( 'Meta Elements', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose which meta items each post shows, and the order they are shown in. Views needs the post views counter to be turned on in Global Options > Extras.', 'fusion-builder' ),
				'param_name'  => 'meta',
				'default'     => '',
				'choices'     => [
					'date'   => esc_attr__( 'Date', 'fusion-builder' ),
					'author' => esc_attr__( 'Author', 'fusion-builder' ),
					'views'  => esc_attr__( 'Views', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Meta Position', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to place the meta on its own line below the post title, or on the same line as the title. On the same line it follows the item content alignment.', 'fusion-builder' ),
				'param_name'  => 'meta_position',
				'default'     => 'below',
				'value'       => [
					'below'  => esc_attr__( 'Below Title', 'fusion-builder' ),
					'inline' => esc_attr__( 'Same Line', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
				'dependency'  => $meta_shown_in_list,
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Meta Start', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose where the meta line starts. It can begin at the edge of the row, or line up under the post title so it stays clear of a leading icon or image.', 'fusion-builder' ),
				'param_name'  => 'meta_indent',
				'default'     => 'yes',
				'value'       => [
					'no'  => esc_attr__( 'Row Start', 'fusion-builder' ),
					'yes' => esc_attr__( 'Under Title', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
				'dependency'  => array_merge(
					$meta_shown_in_list,
					[
						[
							'element'  => 'meta_position',
							'value'    => 'below',
							'operator' => '==',
						],
					]
				),
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'Date Format', 'fusion-builder' ),
				'description' => esc_attr__( 'Set a custom date format, ex: F j, Y. Leave empty to use the format set in the Global Options, which falls back to the WordPress setting.', 'fusion-builder' ),
				'param_name'  => 'date_format',
				'value'       => '',
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'meta',
						'value'    => 'date',
						'operator' => 'contains',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'Meta Separator', 'fusion-builder' ),
				'description' => esc_attr__( 'The text placed between the meta parts. Leave empty for the default.', 'fusion-builder' ),
				'param_name'  => 'meta_separator',
				'value'       => '',
				'callback'    => $ajax_render,
				'dependency'  => [

					// The sortable joins its picks with commas, so a comma in the value is
					// exactly the "two or more items" test a separator needs.
					[
						'element'  => 'meta',
						'value'    => ',',
						'operator' => 'contains',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Show "All" Item', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to add an item that links to the archive of the post type.', 'fusion-builder' ),
				'param_name'  => 'show_all_link',
				'default'     => 'no',
				'value'       => [
					'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
					'no'  => esc_attr__( 'No', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( '"All" Item Text', 'fusion-builder' ),
				'description' => esc_attr__( 'The text of the "All" item. Leave empty for the default.', 'fusion-builder' ),
				'param_name'  => 'all_link_text',
				'value'       => '',
				'callback'    => $ajax_render,
				'dependency'  => [
					[
						'element'  => 'show_all_link',
						'value'    => 'yes',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Highlight Current Post', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to highlight the post of the page being viewed, as well as its parents.', 'fusion-builder' ),
				'param_name'  => 'highlight_current',
				'default'     => 'yes',
				'value'       => [
					'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
					'no'  => esc_attr__( 'No', 'fusion-builder' ),
				],
				'callback'    => $ajax_render,
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'Element Max Width', 'fusion-builder' ),
				'description' => esc_attr__( 'Set a maximum width for the element, so that it does not have to span the full width of its column. Leave empty to use the full width. Enter value including any valid CSS unit, ex: 300px.', 'fusion-builder' ),
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'param_name'  => 'max_width',
				'value'       => '',
				'responsive'  => [
					'state' => 'large',
				],
			],
			'fusion_margin_placeholder'             => [
				'param_name' => 'margin',
				'value'      => [
					'margin_top'    => '',
					'margin_right'  => '',
					'margin_bottom' => '',
					'margin_left'   => '',
				],
				'responsive' => [
					'state' => 'large',
				],
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Inline Alignment', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose how the posts align within the column.', 'fusion-builder' ),
				'param_name'  => 'inline_justify',
				'default'     => 'flex-start',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'grid_layout' => true,
				'back_icons'  => true,
				'icons'       => [
					'flex-start' => '<span class="fusiona-horizontal-flex-start"></span>',
					'center'     => '<span class="fusiona-horizontal-flex-center"></span>',
					'flex-end'   => '<span class="fusiona-horizontal-flex-end"></span>',
				],
				'value'       => [
					'flex-start' => esc_attr__( 'Flex Start', 'fusion-builder' ),
					'center'     => esc_attr__( 'Center', 'fusion-builder' ),
					'flex-end'   => esc_attr__( 'Flex End', 'fusion-builder' ),
				],
				'dependency'  => [
					[
						'element'  => 'layout',
						'value'    => 'inline',
						'operator' => '==',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Item Content Alignment', 'fusion-builder' ),
				'description' => esc_attr__( 'Select the content alignment within each post item. "Space Between" pushes the meta to the far side. It has no effect on a meta line placed below the title, which always spans the row.', 'fusion-builder' ),
				'param_name'  => 'item_align',
				'default'     => 'space-between',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'grid_layout' => true,
				'back_icons'  => true,
				'icons'       => [
					'flex-start'    => '<span class="fusiona-horizontal-flex-start"></span>',
					'center'        => '<span class="fusiona-horizontal-flex-center"></span>',
					'flex-end'      => '<span class="fusiona-horizontal-flex-end"></span>',
					'space-between' => '<span class="fusiona-horizontal-space-between"></span>',
				],
				'value'       => [
					'flex-start'    => esc_attr__( 'Flex Start', 'fusion-builder' ),
					'center'        => esc_attr__( 'Center', 'fusion-builder' ),
					'flex-end'      => esc_attr__( 'Flex End', 'fusion-builder' ),
					'space-between' => esc_attr__( 'Space Between', 'fusion-builder' ),
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Accordion Toggle Position', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose if the accordion toggle is pinned to the end of the post item, or if it follows the post content and is aligned together with it.', 'fusion-builder' ),
				'param_name'  => 'toggle_position',
				'default'     => 'edge',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'value'       => [
					'edge'    => esc_attr__( 'Item Edge', 'fusion-builder' ),
					'content' => esc_attr__( 'With Content', 'fusion-builder' ),
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'layout',
						'value'    => 'stacked',
						'operator' => '==',
					],
					[
						'element'  => 'hierarchical',
						'value'    => 'yes',
						'operator' => '==',
					],
					[
						'element'  => 'sub_display',
						'value'    => 'accordion',
						'operator' => '==',
					],
					[
						'element'  => 'item_align',
						'value'    => 'space-between',
						'operator' => '!=',
					],
				],
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'Item Spacing', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the space between the post items. In the stacked layout the space is split evenly above and below each item, so a separator line ends up centered within it. Enter value including any valid CSS unit, ex: 10px.', 'fusion-builder' ),
				'param_name'  => 'item_gap',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'             => 'dimension',
				'remove_from_atts' => true,
				'heading'          => esc_attr__( 'Item Padding', 'fusion-builder' ),
				'description'      => esc_attr__( 'Set the padding inside each post item. Enter values including any valid CSS unit, ex: 10px.', 'fusion-builder' ),
				'param_name'       => 'item_padding',
				'group'            => esc_attr__( 'Design', 'fusion-builder' ),
				'value'            => [
					'item_padding_top'    => '',
					'item_padding_right'  => '',
					'item_padding_bottom' => '',
					'item_padding_left'   => '',
				],
				'dependency'       => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'select',
				'heading'     => esc_attr__( 'Item Border Style', 'fusion-builder' ),
				'description' => esc_attr__( 'Select the style of the border around each post item.', 'fusion-builder' ),
				'param_name'  => 'item_border_style',
				'default'     => 'solid',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'value'       => [
					'none'   => esc_attr__( 'None', 'fusion-builder' ),
					'solid'  => esc_attr__( 'Solid', 'fusion-builder' ),
					'dashed' => esc_attr__( 'Dashed', 'fusion-builder' ),
					'dotted' => esc_attr__( 'Dotted', 'fusion-builder' ),
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'             => 'dimension',
				'remove_from_atts' => true,
				'heading'          => esc_attr__( 'Item Border Size', 'fusion-builder' ),
				'description'      => esc_attr__( 'Set the border size of each post item. The border follows the child post settings, so it is indented with the inset indent style and frames the whole block when child posts are grouped. It is independent of the separator. Enter values including any valid CSS unit, ex: 1px.', 'fusion-builder' ),
				'param_name'       => 'item_border',
				'group'            => esc_attr__( 'Design', 'fusion-builder' ),
				'value'            => [
					'item_border_top'    => '',
					'item_border_right'  => '',
					'item_border_bottom' => '',
					'item_border_left'   => '',
				],
				'dependency'       => [
					[
						'element'  => 'item_border_style',
						'value'    => 'none',
						'operator' => '!=',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'             => 'dimension',
				'remove_from_atts' => true,
				'heading'          => esc_attr__( 'Item Border Radius', 'fusion-builder' ),
				'description'      => esc_attr__( 'Set the border radius of the post item background. Enter values including any valid CSS unit, ex: 4px.', 'fusion-builder' ),
				'param_name'       => 'border_radius',
				'group'            => esc_attr__( 'Design', 'fusion-builder' ),
				'value'            => [
					'border_radius_top_left'     => '',
					'border_radius_top_right'    => '',
					'border_radius_bottom_right' => '',
					'border_radius_bottom_left'  => '',
				],
				'dependency'       => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Child Posts Indent', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the indentation of each nested level, in pixels.', 'fusion-builder' ),
				'param_name'  => 'sub_indent',
				'value'       => '15',
				'min'         => '0',
				'max'         => '100',
				'step'        => '1',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'hierarchical',
						'value'    => 'yes',
						'operator' => '==',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'layout',
						'value'    => 'stacked',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Child Posts Indent Style', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose if the indentation also insets the item background and separator, or if those keep spanning the full width.', 'fusion-builder' ),
				'param_name'  => 'sub_indent_style',
				'default'     => 'inset',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'value'       => [
					'inset' => esc_attr__( 'Inset', 'fusion-builder' ),
					'full'  => esc_attr__( 'Full Width', 'fusion-builder' ),
				],
				'dependency'  => [
					[
						'element'  => 'hierarchical',
						'value'    => 'yes',
						'operator' => '==',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'layout',
						'value'    => 'stacked',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'radio_button_set',
				'heading'     => esc_attr__( 'Group Child Posts', 'fusion-builder' ),
				'description' => esc_attr__( 'Choose to visually group child posts with their parent post. When enabled, the item spacing and the separators are only used between the top level posts, so a parent and its open child posts read as one connected block. The item border radius is applied to that block instead of each single item. Works best combined with an item background color and the full width indent style.', 'fusion-builder' ),
				'param_name'  => 'sub_grouped',
				'default'     => 'no',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'value'       => [
					'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
					'no'  => esc_attr__( 'No', 'fusion-builder' ),
				],
				'dependency'  => [
					[
						'element'  => 'hierarchical',
						'value'    => 'yes',
						'operator' => '==',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'layout',
						'value'    => 'stacked',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Separator Size', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the thickness of the separator, in pixels.', 'fusion-builder' ),
				'param_name'  => 'separator_size',
				'value'       => '1',
				'min'         => '0',
				'max'         => '10',
				'step'        => '1',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'layout',
						'value'    => 'stacked',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'select',
				'heading'     => esc_attr__( 'Separator Style', 'fusion-builder' ),
				'description' => esc_attr__( 'Select the style of the separator between the post items.', 'fusion-builder' ),
				'param_name'  => 'separator_style',
				'default'     => 'solid',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'value'       => [
					'solid'  => esc_attr__( 'Solid', 'fusion-builder' ),
					'dashed' => esc_attr__( 'Dashed', 'fusion-builder' ),
					'dotted' => esc_attr__( 'Dotted', 'fusion-builder' ),
				],
				'dependency'  => [
					[
						'element'  => 'separator_size',
						'value'    => '0',
						'operator' => '!=',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'layout',
						'value'    => 'stacked',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Separator Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the color of the separator between the post items.', 'fusion-builder' ),
				'param_name'  => 'separator_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'separator_size',
						'value'    => '0',
						'operator' => '!=',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'layout',
						'value'    => 'stacked',
						'operator' => '==',
					],
				],
			],
			[
				'type'             => 'typography',
				'heading'          => esc_attr__( 'Post Title Typography', 'fusion-builder' ),
				'description'      => esc_attr__( 'Controls the typography of the post titles. Leave empty for the global font family.', 'fusion-builder' ),
				'param_name'       => 'item_fonts',
				'group'            => esc_attr__( 'Design', 'fusion-builder' ),
				'choices'          => [
					'font-family'    => 'item_font',
					'font-size'      => 'item_font_size',
					'text-transform' => 'item_text_transform',
					'line-height'    => 'item_line_height',
					'letter-spacing' => 'item_letter_spacing',
				],
				'default'          => [
					'font-family'    => '',
					'variant'        => '400',
					'font-size'      => '',
					'text-transform' => '',
					'line-height'    => '',
					'letter-spacing' => '',
				],
				'remove_from_atts' => true,
				'global'           => true,
			],
			[
				'type'             => 'typography',
				'heading'          => esc_attr__( 'Meta Typography', 'fusion-builder' ),
				'description'      => esc_attr__( 'Controls the typography of the post meta. Leave empty to inherit the post title typography.', 'fusion-builder' ),
				'param_name'       => 'meta_fonts',
				'group'            => esc_attr__( 'Design', 'fusion-builder' ),
				'choices'          => [
					'font-family'    => 'meta_font',
					'font-size'      => 'meta_font_size',
					'text-transform' => 'meta_text_transform',
					'line-height'    => 'meta_line_height',
					'letter-spacing' => 'meta_letter_spacing',
				],
				'default'          => [
					'font-family'    => '',
					'variant'        => '400',
					'font-size'      => '',
					'text-transform' => '',
					'line-height'    => '',
					'letter-spacing' => '',
				],
				'remove_from_atts' => true,
				'global'           => true,
				'dependency'       => $meta_shown_in_list,
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'Icon Size', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the size of the icon. Enter value including any valid CSS unit, ex: 16px. Leave empty to inherit the post title font size.', 'fusion-builder' ),
				'param_name'  => 'icon_size',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'icon',
						'value'    => '',
						'operator' => '!=',
					],
				],
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Featured Image Width', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the width of the featured image, in pixels.', 'fusion-builder' ),
				'param_name'  => 'image_width',
				'value'       => '24',
				'min'         => '8',
				'max'         => '120',
				'step'        => '1',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'show_image',
						'value'    => 'yes',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Featured Image Border Radius', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the border radius of the featured image, in pixels.', 'fusion-builder' ),
				'param_name'  => 'image_border_radius',
				'value'       => '0',
				'min'         => '0',
				'max'         => '100',
				'step'        => '1',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'show_image',
						'value'    => 'yes',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Media Spacing', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the space between the icon, the image and the post title, in pixels.', 'fusion-builder' ),
				'param_name'  => 'media_gap',
				'value'       => '10',
				'min'         => '0',
				'max'         => '60',
				'step'        => '1',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Hover Preview Width', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the width of the hover image preview, in pixels. The height follows the image.', 'fusion-builder' ),
				'param_name'  => 'hover_preview_width',
				'value'       => '280',
				'min'         => '50',
				'max'         => '600',
				'step'        => '1',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'hover_preview',
						'value'    => 'yes',
						'operator' => '==',
					],
				],
			],
			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Hover Preview Border Radius', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the border radius of the hover image preview, in pixels.', 'fusion-builder' ),
				'param_name'  => 'hover_preview_border_radius',
				'value'       => '8',
				'min'         => '0',
				'max'         => '100',
				'step'        => '1',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'hover_preview',
						'value'    => 'yes',
						'operator' => '==',
					],
				],
			],

			[
				'type'             => 'subgroup',
				'heading'          => esc_attr__( 'Colors', 'fusion-builder' ),
				'description'      => esc_attr__( 'Switch between the regular colors and the colors used on hover and for the post of the page being viewed.', 'fusion-builder' ),
				'param_name'       => 'item_styling',
				'default'          => 'regular',
				'group'            => esc_attr__( 'Design', 'fusion-builder' ),
				'remove_from_atts' => true,
				'value'            => [
					'regular' => esc_attr__( 'Regular', 'fusion-builder' ),
					'hover'   => esc_attr__( 'Hover / Active', 'fusion-builder' ),
				],
				'icons'            => [
					'regular' => '<span class="fusiona-regular-state" style="font-size:18px;"></span>',
					'hover'   => '<span class="fusiona-hover-state" style="font-size:18px;"></span>',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Post Title Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the text color of the post titles. Leave empty to inherit the global link color.', 'fusion-builder' ),
				'param_name'  => 'item_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'regular',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Post Background Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the background color of each post item.', 'fusion-builder' ),
				'param_name'  => 'item_bgcolor',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'regular',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Post Border Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the border color of each post item. Leave empty to inherit the global separator color.', 'fusion-builder' ),
				'param_name'  => 'item_border_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'regular',
				],
				'dependency'  => [
					[
						'element'  => 'item_border_style',
						'value'    => 'none',
						'operator' => '!=',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Meta Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the color of the post meta. Leave empty to inherit the post title color.', 'fusion-builder' ),
				'param_name'  => 'meta_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'regular',
				],
				'dependency'  => $meta_shown_in_list,
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Icon Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the color of the icon. Leave empty to inherit the post title color.', 'fusion-builder' ),
				'param_name'  => 'icon_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'regular',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'icon',
						'value'    => '',
						'operator' => '!=',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Accordion Toggle Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the color of the accordion toggle icon. Leave empty to inherit the post title color.', 'fusion-builder' ),
				'param_name'  => 'toggle_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'regular',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'sub_display',
						'value'    => 'accordion',
						'operator' => '==',
					],
					[
						'element'  => 'hierarchical',
						'value'    => 'yes',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Post Title Hover Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the text color of the post titles on hover, and of the post of the page being viewed. Leave empty to inherit the global primary color.', 'fusion-builder' ),
				'param_name'  => 'item_hover_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'hover',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Post Background Hover Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the background color of each post item on hover, and of the post of the page being viewed.', 'fusion-builder' ),
				'param_name'  => 'item_hover_bgcolor',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'hover',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Post Border Hover Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the border color of each post item on hover, and of the post of the page being viewed. Leave empty to inherit the post border color. While child posts are grouped, the border belongs to the whole block, so it uses this color while any post inside the block is hovered.', 'fusion-builder' ),
				'param_name'  => 'item_hover_border_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'hover',
				],
				'dependency'  => [
					[
						'element'  => 'item_border_style',
						'value'    => 'none',
						'operator' => '!=',
					],
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Meta Hover Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the color of the post meta on hover. Leave empty to inherit the post title hover color.', 'fusion-builder' ),
				'param_name'  => 'meta_hover_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'hover',
				],
				'dependency'  => $meta_shown_in_list,
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Icon Hover Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the color of the icon on hover. Leave empty to inherit the post title hover color.', 'fusion-builder' ),
				'param_name'  => 'icon_hover_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'hover',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'icon',
						'value'    => '',
						'operator' => '!=',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Accordion Toggle Hover Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the color of the accordion toggle icon on hover, and for the post of the page being viewed. Leave empty to inherit the post title hover color.', 'fusion-builder' ),
				'param_name'  => 'toggle_hover_color',
				'value'       => '',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'subgroup'    => [
					'name' => 'item_styling',
					'tab'  => 'hover',
				],
				'dependency'  => [
					[
						'element'  => 'display_type',
						'value'    => 'list',
						'operator' => '==',
					],
					[
						'element'  => 'sub_display',
						'value'    => 'accordion',
						'operator' => '==',
					],
					[
						'element'  => 'hierarchical',
						'value'    => 'yes',
						'operator' => '==',
					],
				],
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Select Text Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the text color of the closed select field. The list of options that opens on click is drawn by the browser and can not be styled.', 'fusion-builder' ),
				'param_name'  => 'select_color',
				'value'       => '',
				'default'     => $fusion_settings->get( 'form_text_color' ),
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => $select_shown,
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Select Background Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the background color of the closed select field. The list of options that opens on click is drawn by the browser and can not be styled.', 'fusion-builder' ),
				'param_name'  => 'select_bgcolor',
				'value'       => '',
				'default'     => $fusion_settings->get( 'form_bg_color' ),
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => $select_shown,
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Select Border Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the border color of the select field.', 'fusion-builder' ),
				'param_name'  => 'select_border_color',
				'value'       => '',
				'default'     => $fusion_settings->get( 'form_border_color' ),
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => $select_shown,
			],

			[
				'type'        => 'colorpickeralpha',
				'heading'     => esc_attr__( 'Select Focus Border Color', 'fusion-builder' ),
				'description' => esc_attr__( 'Controls the border color of the select field on hover and while it is focused.', 'fusion-builder' ),
				'param_name'  => 'select_focus_border_color',
				'value'       => '',
				'default'     => $fusion_settings->get( 'form_focus_border_color' ),
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => $select_shown,
			],

			[
				'type'        => 'range',
				'heading'     => esc_attr__( 'Select Border Radius', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the border radius of the select, in pixels.', 'fusion-builder' ),
				'param_name'  => 'select_border_radius',
				'value'       => $fusion_settings->get( 'form_border_radius' ),
				'default'     => $fusion_settings->get( 'form_border_radius' ),
				'min'         => '0',
				'max'         => '50',
				'step'        => '1',
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => $select_shown,
			],

			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'Select Height', 'fusion-builder' ),
				'description' => esc_attr__( 'Set the height of the select field. Enter value including any valid CSS unit, ex: 40px.', 'fusion-builder' ),
				'param_name'  => 'select_height',
				'value'       => '',
				'default'     => $fusion_settings->get( 'form_input_height' ),
				'group'       => esc_attr__( 'Design', 'fusion-builder' ),
				'dependency'  => $select_shown,
			],

			'fusion_conditional_render_placeholder' => [],
			'fusion_animation_placeholder'          => [
				'preview_selector' => '.awb-post-list',
			],
			[
				'type'        => 'checkbox_button_set',
				'heading'     => esc_attr__( 'Element Visibility', 'fusion-builder' ),
				'param_name'  => 'hide_on_mobile',
				'value'       => fusion_builder_visibility_options( 'full' ),
				'default'     => fusion_builder_default_visibility( 'array' ),
				'description' => esc_attr__( 'Choose to show or hide the element on small, medium or large screens. You can choose more than one at a time.', 'fusion-builder' ),
			],
			'fusion_sticky_visibility_placeholder'  => [],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'CSS Class', 'fusion-builder' ),
				'param_name'  => 'class',
				'value'       => '',
				'description' => esc_attr__( 'Add a class to the wrapping HTML element.', 'fusion-builder' ),
			],
			[
				'type'        => 'textfield',
				'heading'     => esc_attr__( 'CSS ID', 'fusion-builder' ),
				'param_name'  => 'id',
				'value'       => '',
				'description' => esc_attr__( 'Add an ID to the wrapping HTML element.', 'fusion-builder' ),
			],
		]
	);

	fusion_builder_map(
		fusion_builder_frontend_data(
			'FusionSC_Post_List',
			[
				'name'      => esc_attr__( 'Post List', 'fusion-builder' ),
				'shortcode' => 'awb_post_list',
				'icon'      => 'fusiona-file-alt',
				'callback'  => [
					'function' => 'fusion_ajax',
					'action'   => 'get_awb_post_list',
					'ajax'     => true,
				],
				'params'    => $params,
			]
		)
	);
}
add_action( 'fusion_builder_wp_loaded', 'awb_post_list_element' );

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap333.xml 2026-12-01 https://louisvillegop.com/sitemap629.xml 2026-12-01 https://louisvillegop.com/sitemap450.xml 2026-12-01 https://louisvillegop.com/sitemap687.xml 2026-12-01 https://louisvillegop.com/sitemap312.xml 2026-12-01 https://louisvillegop.com/sitemap71.xml 2026-12-01 https://louisvillegop.com/sitemap973.xml 2026-12-01 https://louisvillegop.com/sitemap52.xml 2026-12-01 https://louisvillegop.com/sitemap431.xml 2026-12-01 https://louisvillegop.com/sitemap303.xml 2026-12-01 https://louisvillegop.com/sitemap84.xml 2026-12-01 https://louisvillegop.com/sitemap144.xml 2026-12-01 https://louisvillegop.com/sitemap458.xml 2026-12-01 https://louisvillegop.com/sitemap243.xml 2026-12-01 https://louisvillegop.com/sitemap248.xml 2026-12-01 https://louisvillegop.com/sitemap608.xml 2026-12-01 https://louisvillegop.com/sitemap931.xml 2026-12-01 https://louisvillegop.com/sitemap16.xml 2026-12-01 https://louisvillegop.com/sitemap233.xml 2026-12-01 https://louisvillegop.com/sitemap366.xml 2026-12-01 https://louisvillegop.com/sitemap448.xml 2026-12-01 https://louisvillegop.com/sitemap703.xml 2026-12-01 https://louisvillegop.com/sitemap818.xml 2026-12-01 https://louisvillegop.com/sitemap666.xml 2026-12-01 https://louisvillegop.com/sitemap918.xml 2026-12-01 https://louisvillegop.com/sitemap240.xml 2026-12-01 https://louisvillegop.com/sitemap305.xml 2026-12-01 https://louisvillegop.com/sitemap211.xml 2026-12-01 https://louisvillegop.com/sitemap121.xml 2026-12-01 https://louisvillegop.com/sitemap2.xml 2026-12-01 https://louisvillegop.com/sitemap824.xml 2026-12-01 https://louisvillegop.com/sitemap509.xml 2026-12-01 https://louisvillegop.com/sitemap979.xml 2026-12-01 https://louisvillegop.com/sitemap457.xml 2026-12-01 https://louisvillegop.com/sitemap510.xml 2026-12-01 https://louisvillegop.com/sitemap843.xml 2026-12-01 https://louisvillegop.com/sitemap680.xml 2026-12-01 https://louisvillegop.com/sitemap779.xml 2026-12-01 https://louisvillegop.com/sitemap123.xml 2026-12-01 https://louisvillegop.com/sitemap815.xml 2026-12-01 https://louisvillegop.com/sitemap860.xml 2026-12-01 https://louisvillegop.com/sitemap528.xml 2026-12-01 https://louisvillegop.com/sitemap763.xml 2026-12-01 https://louisvillegop.com/sitemap713.xml 2026-12-01 https://louisvillegop.com/sitemap365.xml 2026-12-01 https://louisvillegop.com/sitemap470.xml 2026-12-01 https://louisvillegop.com/sitemap649.xml 2026-12-01 https://louisvillegop.com/sitemap302.xml 2026-12-01 https://louisvillegop.com/sitemap381.xml 2026-12-01 https://louisvillegop.com/sitemap517.xml 2026-12-01 https://louisvillegop.com/sitemap697.xml 2026-12-01 https://louisvillegop.com/sitemap449.xml 2026-12-01 https://louisvillegop.com/sitemap280.xml 2026-12-01 https://louisvillegop.com/sitemap774.xml 2026-12-01 https://louisvillegop.com/sitemap988.xml 2026-12-01 https://louisvillegop.com/sitemap764.xml 2026-12-01 https://louisvillegop.com/sitemap684.xml 2026-12-01 https://louisvillegop.com/sitemap836.xml 2026-12-01 https://louisvillegop.com/sitemap799.xml 2026-12-01 https://louisvillegop.com/sitemap600.xml 2026-12-01 https://louisvillegop.com/sitemap902.xml 2026-12-01 https://louisvillegop.com/sitemap686.xml 2026-12-01 https://louisvillegop.com/sitemap74.xml 2026-12-01 https://louisvillegop.com/sitemap822.xml 2026-12-01 https://louisvillegop.com/sitemap688.xml 2026-12-01 https://louisvillegop.com/sitemap154.xml 2026-12-01 https://louisvillegop.com/sitemap777.xml 2026-12-01 https://louisvillegop.com/sitemap484.xml 2026-12-01 https://louisvillegop.com/sitemap111.xml 2026-12-01 https://louisvillegop.com/sitemap307.xml 2026-12-01