/home/fdhrevqn/public_html/wp-content/plugins.disabled/fox-framework/inc/params.php
<?php
function fox_get_params( $base = '' ) {
    
    $params = [];
    
    /* STANDARD
    ------------------------------------------------------------------------------------------------------------------------ */
    if ( 'standard' == $base ) {
    
        $params[] = [
            'type' => 'heading',
            'title' => 'General Layout',
        ];
        
        $params[ 'header_align' ] = array(
            'title' => 'Header text align',
            'type' => 'select',
            'options' => array(
                '' => 'Default',
                'left' => 'Left',
                'center' => 'Center',
                'right' => 'Right',
            ),
            'std' => '',
        );
        
        $params[ 'text_color' ] = array(
            'title' => 'Custom Text Color',
            'type' => 'color',
        );
        
        $params[ 'content_excerpt' ] = array(
            'title' => 'Display content/excerpt',
            'type' => 'select',
            'options' => [
                'content' => 'Full Content',
                'excerpt' => 'Excerpt',
            ],
            'std' => 'excerpt',
        );
        
        $params[ 'thumbnail_type' ] = array (
            'title' => 'Thumbnail type',
            'type' => 'select',
            'options' => [
                'advanced' => 'Full slider, video etc',
                'simple' => 'Just simple image thumbnail',
            ],
            'std' => 'simple',
        );
        
        /* Elements
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'Elements',
        ];
        
        $params[ 'show_thumbnail' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show thumbnail',
        );
        
        $params[ 'thumbnail_shape' ] = array(
            'type'  => 'select',
            'std'   => 'acute',
            'options' => [
                'acute'     => 'Acute',
                'round'     => 'Round',
                'circle'    => 'Circle',
            ],
            'title' => 'Thumbnail shape',
        );
        
        $params[ 'show_title' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show title',
        );
        
        $params[ 'excerpt_more' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show excerpt more',
        );
        
        $params[ 'show_date' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show date',
        );
        
        $params[ 'show_category' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show category',
        );
        
        $params[ 'show_author' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show author',
        );
        
        $params[ 'show_author_avatar' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show author avatar',
        );
        
        $params[ 'show_comment_link' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show comment link',
        );
        
        $params[ 'show_view' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show view count',
        );
        
        $params[ 'show_reading_time' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show reading time',
        );
        
        $params[ 'show_share' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show share icons',
        );
        
        $params[ 'show_related' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show related posts',
        );
    
    }
    
    /* GRID
    ------------------------------------------------------------------------------------------------------------------------ */
    if ( 'grid' == $base ) {
        
        /* General Layout
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'General Layout',
        ];
        
        $params[ 'column' ] = array(
            'type' => 'select',
            'options' => fox_column_support(),
            'std' => '3',
            'title' => 'Column',
        );
        
        $params[ 'first_standard' ] = array(
            'title' => 'First post is standard layout?',
            'type' => 'switcher',
            'std' => '',
        );
        
        $params[ 'item_card' ] = array(
            'title' => 'Card Style',
            'type' => 'select',
            'std' => 'none',
            'options' => fox_card_style_support()
        );
        
        $params[ 'item_spacing' ] = array(
            'type' => 'select',
            'options' => fox_item_spacing_support(),
            'std' => 'normal',
            'title' => 'Item spacing (Grid/Masonry)',
        );
        
        $params[ 'item_align' ] = array(
            'title' => 'Item alignment (Grid/Masonry)',
            'type' => 'select',
            'options' => array(
                '' => 'Default',
                'left' => 'Left',
                'center' => 'Center',
                'right' => 'Right',
            ),
            'std' => '',
        );
        
        $params[ 'item_template' ] = array(
            'title' => 'Elements order',
            'type' => 'select',
            
            'options' => fox_item_template_support(),
            'std' => '1',
        );
        
        $params[ 'item_border' ] = [
            'title' => 'Vertical border between items',
            'type' => 'switcher',
            'std' => 'no',
        ];

        $params[ 'item_border_color' ] = [
            'title' => 'Border color?',
            'type' => 'color',
        ];
        
        $params[ 'text_color' ] = array(
            'title' => 'Custom Text Color',
            'type' => 'color',
        );
        
        $params[ 'list_sep' ] = array(
            'type' => 'switcher',
            'title' => 'Sep between list items',
            'std' => 'yes',
        );
        
        $params[ 'list_sep_style' ] = array(
            'type' => 'select',
            'options' => fox_list_sep_style_support(),
            'std' => 'solid',
            'title' => 'List sep border style',
        );
        
        $params[ 'list_sep_color' ] = array(
            'type' => 'color',
            'title' => 'List separator color',
        );
        
        $params[ 'list_spacing' ] = array(
            'type' => 'select',
            'title' => 'Spacing between list items',
            'std' => 'normal',
            'options' => fox_list_spacing_support(),
            'std' => 'normal',
        );
        
        $params[ 'list_valign' ] = array(
            'type' => 'select',
            'title' => 'Post list vertical align',
            'std' => 'top',
            'options' => [
                'top' => 'Top',
                'middle' => 'Middle',
                'bottom' => 'Bottom',
            ],
            'std' => 'top',
        );
    
        /* Thumbnail
         * ------------------------ */
        $params[ 'thumbnail_heading' ] = [
            'type' => 'heading',
            'title' => 'Thumbnail',
            
            'section' => 'thumbnail',
            'section_title' => 'Thumbnail',
        ];
        
        $params[ 'show_thumbnail' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show thumbnail',
        );
        
        $params[ 'thumbnail_position' ] = array(
            'type' => 'select',
            'options'   => fox_thumbnail_position_support(),
            'std' => 'left',
            'title' => 'Thumbnail position (List/Vertical layout)',
        );
        
        $params[ 'thumbnail_width' ] = array(
            'type' => 'text',
            'placeholder' => 'Eg. 320px',
            'title' => 'Thumbnail width (List layout)',
        );
        
        $params[ 'list_mobile_layout' ] = array(
            'type' => 'select',
            'title' => 'Mobile Layout (for List layout)',
            'options' => [
                'list' => 'Still list as desktop',
                'grid' => 'Stack (Image above, content below)',
            ],
            'std'   => 'grid',
        );
        
        $params[ 'thumbnail' ] = array(
            'type' => 'select',
            'options' => fox_thumbnail_support(),
            'std' => 'landscape',
            'title' => 'Thumbnail',
        );

        $params[ 'thumbnail_custom' ] = array(
            'type' => 'text',
            'title' => 'Custom Size (Eg. 425x360)',
        );

        $params[ 'thumbnail_placeholder' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Placeholder thumbnail',
            'desc' => 'For posts dont have a thumbnail'
        );

        $params[ 'thumbnail_shape' ] = array(
            'type'  => 'select',
            'std'   => 'acute',
            'options' => fox_thumbnail_shape_support(),
            'title' => 'Thumbnail shape',
        );
        
        $params[ 'thumbnail_hover_effect' ] = array(
            'type'  => 'select',
            'std'   => 'none',
            'options' => fox_thumbnail_hover_support(),
            'title' => 'Thumbnail hover effect',
        );
        
        $params[ 'thumbnail_hover_logo' ] = array(
            'type'  => 'image',
            'title' => 'Thumbnail hover logo',
        );
        
        $params[ 'thumbnail_hover_logo_width' ] = array(
            'type'  => 'text',
            'std'   => '40%',
            'title' => 'Thumbnail hover logo width',
            'desc' => 'Please enter a number in percentage.',
        );
        
        $params[ 'thumbnail_showing_effect' ] = array(
            'type'  => 'select',
            'std'   => 'none',
            'options' => fox_thumbnail_showing_effect_support(),
            'title' => 'Thumbnail showing effect',
        );
        
        $params[ 'format_indicator' ] = array(
            'type'  => 'switcher',
            'std'   => 'yes',
            'title' => 'Show format indicator',
        );
        
        $params[ 'thumbnail_index' ] = array(
            'type'  => 'switcher',
            'std'   => '',
            'title' => 'Index 01, 02.. on thumbnail',
        );
        
        $params[ 'thumbnail_view' ] = array(
            'type'  => 'switcher',
            'std'   => '',
            'title' => 'Display view count',
        );
        
        /* Title
         * ------------------------ */
        $params[ 'title_heading' ] = [
            'type' => 'heading',
            'title' => 'Title',
            
            'section' => 'text',
            'section_title' => 'Text',
        ];
        
        $params[ 'show_title' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show title',
        );
        
        $params[ 'title_tag' ] = array(
            'type' => 'select',
            'options' => fox_title_tag_support(),
            'std' => 'h2',
            'title' => 'Title tag',
        );
        
        $params[ 'title_size' ] = array(
            'type'  => 'select',
            'std'   => 'normal',
            'options' => fox_title_size_support(),
            'title' => 'Title size',
        );
        
        $params[ 'title_weight' ] = array(
            'type'  => 'select',
            'std'   => '',
            'options' => fox_title_weight_support(),
            'title' => 'Title weight',
        );
        
        $params[ 'title_text_transform' ] = array(
            'type'  => 'select',
            'std'   => '',
            'options' => fox_title_transform_support(),
            'title' => 'Title text transform',
        );
        
        $params[ 'title_color' ] = [
            'type' => 'color',
            'title' => 'Title color',
        ];
        
        /* Excerpt
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'Excerpt',
        ];
        
        $params[ 'show_excerpt' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Display excerpt?',
        );

        $params[ 'excerpt_length' ] = array(
            'type' => 'text',
            'std' => '22',
            'title' => 'Excerpt length',
        );
        
        $params[ 'excerpt_size' ] = array(
            'type' => 'select',
            'options' => fox_excerpt_size_support(),
            'title' => 'Excerpt font size',
            'std'   => 'normal',
        );
        
        $params[ 'excerpt_color' ] = array(
            'type' => 'color',
            'title' => 'Excerpt custom color',
        );

        $params[ 'excerpt_more' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'More Link',
        );
        
        $params[ 'excerpt_more_style' ] = array(
            'type' => 'select',
            'options' => fox_excerpt_more_style_support(),
            'std' => 'simple',
            'title' => 'More text style',
        );
        
        $params[ 'excerpt_more_text' ] = array(
            'type' => 'text',
            'placeholder' => 'More',
            'title' => 'Custom More Text',
        );
        
        /* Date
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'Date',
        ];
        
        $params[ 'show_date' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show post date',
        );
        
        /* Category
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'Category',
        ];
        
        $params[ 'show_category' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show post categories',
        );

        /* Author
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'Author',
        ];
        
        $params[ 'show_author' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show post author',
        );

        $params[ 'show_author_avatar' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show author avatar',
        );

        /* View count
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'View Count',
        ];
        
        $params[ 'show_view' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show view count',
        );

        /* Comment link
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'Comment Link',
        ];
        
        $params[ 'show_comment_link' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show comment link',
        );

        /* Reading Time
         * ------------------------ */
        $params[] = [
            'type' => 'heading',
            'title' => 'Reading Time',
        ];
        
        $params[ 'show_reading_time' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show reading time',
        );
    
    }
    
    return $params;

}

/** 
 * Returns blog grid options, used commonly in both Elementor and Customizer
 * @since 4.0
 */
function fox_generate_options( $args = [] ) {
    
    extract( wp_parse_args( $args, [
        'base' => '',
        'exclude' => [],
        'override' => [],
        'append' => [],
        'context' => 'customizer',
        'prefix' => '',
        
        // general for all
        'section' => '',
        'section_title' => '',
        'panel' => '',
        
    ] ) );
    
    $params = fox_get_params( $base );
    if ( ! $params ) return [];
    
    // exclude
    if ( ! empty( $exclude ) ) {
        foreach ( $params as $id => $param ) {
            if ( in_array( $id, $exclude ) ) unset( $params[ $id ] );
        }
    }
    
    // override
    if ( ! empty( $override ) ) {
        foreach ( $override as $id => $param ) {
            if ( isset( $params[ $id ] ) ) {
                $params[ $id ] = wp_parse_args( $param, $params[ $id ] );
            } else {
                $params[ $id ] = $param;
            }
        }
    }
    
    // append
    if ( ! empty( $append ) ) {
        
        $append_arr = [];
        $current_after = 'allllll';
        
        foreach ( $append as $id => $param ) {
            $after = isset( $param[ 'after' ] ) ? $param[ 'after' ] : '';
            if ( $after ) {
                $current_after = $after;
                if ( ! isset( $append_arr[ $current_after ] ) ) $append_arr[ $current_after ] = [];
            }
            $append_arr[ $current_after ][ $id ] = $param;
        }
        
        $final_params = [];
        foreach ( $params as $id => $param ) {
            $final_params[ $id ] = $param;
            if ( isset( $append_arr[ $id ] ) ) {
                foreach ( $append_arr[ $id ] as $more_id => $more_param ) {
                    $final_params[ $more_id ] = $more_param;
                }
            }
        }
        if ( isset( $append_arr[ 'allllll' ] ) ) {
            
            $final_params += $append_arr[ 'allllll' ];
            
        }
        
        // restore it
        $params = $final_params;
        
    }
    
    /* Return param list for elementor
    ---------------------------------------- */
    if ( 'elementor' == $context ) {
    
        $return = [];
        
        foreach ( $params as $id => $param ) {
            
            extract( wp_parse_args( $param, [
                'name' => '',
                'std' => '',
            ] ) );
            
            /// title becomes name
            if ( $name ) {
                unset( $param[ 'name' ] );
                $param[ 'title' ] = $title;
            }
            
            $final_id = $id;
            if ( is_numeric( $id ) ) {
                $final_id = 'heading_' . $id;
            }
            
            // prefix
            if ( $prefix ) $final_id = $prefix . $final_id;
            
            // section, panel
            if ( $section ) {
                $param[ 'section' ] = $section;
                $section = ''; // elementor is weird while we can't redeclare section
                if ( $section_title ) {
                    $param[ 'section_title' ] = $section_title;
                    $section_title = '';
                }
            }
            
            $return[ $final_id ] = $param;
        
        }
        
        return $return;
        
        
    /* Return param list for customizer
    ---------------------------------------- */
    } elseif ( 'customizer' == $context ) {
        
        $return = [];
        
        foreach ( $params as $id => $param ) {
            
            extract( wp_parse_args( $param, [
                'type' => '',
                'title' => '',
                'std' => '',
            ] ) );
            
            if ( '' == $type ) {
                var_dump( $id );
            }
            
            /// switcher becomes enable shorthand
            if ( 'switcher' == $type ) {
                unset( $param[ 'type' ] );
                $param[ 'shorthand' ] = 'enable';
                if ( 'yes' == $std ) {
                    $param[ 'std' ] = 'true';
                } else {
                    $param[ 'std' ] = 'false';
                }
            }
            
            /// title becomes name
            if ( $title ) {
                unset( $param[ 'title' ] );
                $param[ 'name' ] = $title;
            }
            
            // prefix
            $final_id = $id;
            if ( $prefix ) $final_id = $prefix . $final_id;
            
            // section, panel
            if ( $section ) $param[ 'section' ] = $section;
            if ( $section_title ) $param[ 'section_title' ] = $section_title;
            if ( $panel ) $param[ 'panel' ] = $panel;
            
            $return[ $final_id ] = $param;
        
        }
        
        return $return;
        
    }
       
}

/**
 * blog control components
 * return @array of compoents
 * @since 4.0
 */
function fox_component_params( $exclude = [], $override = [] ) {
    
    $params = [];
    
    $params[ 'show_thumbnail' ] = array(
        'type' => 'switcher',
        'std' => 'yes',
        'title' => 'Show thumbnail',
        
        'section' => 'components',
        'section_title' => 'components',
    );
    
    $params[ 'show_title' ] = array(
        'type' => 'switcher',
        'std' => 'yes',
        'title' => 'Show title',
    );
    
    $params[ 'excerpt' ] = array(
        'type' => 'switcher',
        'std' => 'yes',
        'title' => 'Display excerpt?',
    );
    
    $params[ 'excerpt_length' ] = array(
        'type' => 'text',
        'std' => '22',
        'title' => 'Excerpt length',
    );
    
    $params[ 'more' ] = array(
        'type' => 'switcher',
        'std' => 'yes',
        'title' => 'More Link',
    );
    
    $params[ 'show_date' ] = array(
        'type' => 'switcher',
        'std' => 'yes',
        'title' => 'Show post date',
    );
    
    $params[ 'show_category' ] = array(
        'type' => 'switcher',
        'std' => 'yes',
        'title' => 'Show post categories',
    );
    
    $params[ 'show_author' ] = array(
        'type' => 'switcher',
        'std' => '',
        'title' => 'Show post author',
    );
    
    $params[ 'show_author_avatar' ] = array(
        'type' => 'switcher',
        'std' => '',
        'title' => 'Show author thumbnail',
    );
    
    $params[ 'show_view' ] = array(
        'type' => 'switcher',
        'std' => '',
        'title' => 'Show view count',
    );
    
    $params[ 'show_comment_link' ] = array(
        'type' => 'switcher',
        'std' => '',
        'title' => 'Show comment link',
    );
    
    $params[ 'show_reading_time' ] = array(
        'type' => 'switcher',
        'std' => '',
        'title' => 'Show reading time',
    );
    
    // exclude
    // and set section 'query'
    $first = true;
    foreach ( $params as $id => $param ) {
        if ( in_array( $id, $exclude ) ) {
            unset( $params[ $id ] );
        } elseif ( $first ) {
            $params[ $id ][ 'section' ] = 'components';
            $params[ $id ][ 'section_title' ] = 'Components';
            $first = false;
        }
    }
    
    // OVERRIDE
    foreach ( $params as $id => $arr ) {
        if ( isset( $override[ $id ] ) ) $params[ $id ] = $override[ $id ];
    }
    
    return apply_filters( 'fox_default_component_params', $params );
    
}

/* THUMBNAIL
------------------------------------------------------------------------------------------------------------------------------------ */
if ( ! function_exists( 'fox_thumbnail_params' ) ) :
/**
 * Thumbnail params
 * @since 4.0
 */
function fox_thumbnail_params( $args = [] ) {
    
    extract( wp_parse_args( $args, [
        'include' => [],
        'exclude' => [],
        'override' => []
    ] ) );
    
    $params = [];
    
    $params[ 'thumbnail' ] = array(
        'type' => 'select',
        'options' => [
            'landscape' => 'Landscape',
            'square' => 'Square',
            'portrait' => 'Portrait',
            'original' => 'Original (No Crop)',
            'custom' => 'Custom',
        ],
        'std' => 'landscape',
        'title' => 'Thumbnail',
        
        'section' => 'thumbnail',
        'section_title' => 'Thumbnail',
    );
    
    $params[ 'thumbnail_custom' ] = array(
        'type' => 'text',
        'title' => 'Custom Size (Eg. 425x360)',
    );
    
    $params[ 'thumbnail_placeholder' ] = array(
        'type' => 'switcher',
        'std' => 'yes',
        'title' => 'Placeholder thumbnail',
        'desc' => 'For posts dont have a thumbnail'
    );
    
    $params[ 'thumbnail_shape' ] = array(
        'type'  => 'select',
        'std'   => 'acute',
        'options' => [
            'acute'     => 'Acute',
            'round'     => 'Round',
            'circle'    => 'Circle',
        ],
        'title' => 'Thumbnail shape',
    );
    
    // only include
    if ( ! empty( $include ) ) {
        foreach ( $params as $id => $param ) {
            if ( ! in_array( $id, $include ) ) unset( $params[ $id ] );
        }
    }
    
    // exclude
    if ( ! empty( $exclude ) ) {
        foreach ( $params as $id => $param ) {
            if ( in_array( $id, $exclude ) ) unset( $params[ $id ] );
        }
    }
    
    // override
    if ( ! empty( $override ) ) {
        foreach ( $override as $id => $param ) {
            $params[ $id ] = $param;
        }
    }
    
    // name vs title
    // and id
    foreach ( $params as $id => $param ) {
        
        // to use in widget / metabox
        $param[ 'id' ] = $id;
        
        // name vs title
        if ( isset( $param[ 'title' ] ) ) $param[ 'name' ] = $param[ 'title' ];
        elseif ( isset( $param[ 'name' ] ) ) $param[ 'title' ] = $param[ 'name' ];
        
        $params[ $id ] = $param;
        
    }
    
    return apply_filters( 'fox_thumbnail_params', $params );
    
}
endif;

function fox_post_group1_params() {
    
    $params = foxele_query_params();
    
    /* General
    ------------------------------------ */
    $params[ 'bigpost_ratio' ] = array(
        'type' => 'select',
        'title' => 'Big post ratio',
        'options' => array(
            '2/3' => '2/3',
            '3/4' => '3/4',
        ),
        'std' => '2/3',

        'section' => 'layout',
        'section_title' => 'Layout',
    );

    $params[ 'bigpost_position' ] = array(
        'type' => 'select',
        'title' => 'Big post position',
        'options' => array(
            'left'  => 'Left',
            'right' => 'Right',
        ),
        'std' => 'left',
    );

    $params[ 'text_color' ] = array(
        'type' => 'color',
        'title' => 'Custom Text Color',
    );

    $params[ 'sep_border' ] = array(
        'type' => 'switcher',
        'std' => '',
        'title' => 'Border between big posts & small posts',
    );

    $params[ 'sep_border_color' ] = array(
        'type' => 'color',
        'title' => 'Border color',
    );
    
    /* Big Post
    ------------------------------------ */
    $params += fox_generate_options([
        'base' => 'grid',
        'prefix' => 'bigpost_',
        'context' => 'elementor',

        'exclude' => [
            'first_standard',
            'item_card',
            'column',
            'item_spacing',
            'item_border',
            'item_border_color',
            'text_color',
            'list_sep',
            'list_sep_style',
            'list_sep_color',
            'list_spacing',
            'list_valign',
            'thumbnail_position',
            'thumbnail_width',
            'list_mobile_layout',
            'thumbnail_placeholder',
            
            'thumbnail_index',
            'thumbnail_heading',
            'title_heading',
        ],

        'append' => [

            'thumbnail_type' => [
                'title' => 'Thumbnail Type',
                'type' => 'select',
                'options' => [
                    'advanced' => 'Full slider, video etc',
                    'simple' => 'Just simple image thumbnail',
                ],
                'std' => 'simple',
                'after' => 'show_thumbnail',
            ],
            
            'thumbnail_caption' => [
                'title' => 'Thumbnail caption?',
                'type' => 'switcher',
                'std' => '',
                'after' => 'show_thumbnail',
            ],
            
            'thumbnail_order' => [
                'title' => 'Thumbnail/Text order',
                'type' => 'select',
                'options' => [
                    'before' => 'Before content',
                    'after' => 'After content',
                ],
                'std' => 'before',
                'after' => 'show_thumbnail',
            ],

        ],

        'override' => [
            'title_size' => [
                'std' => 'medium',
            ],
            'item_align' => [
                'title' => 'Item alignment',
                'std' => 'center',
            ],
            'thumbnail' => [
                // why we overrided the 'options'?
                // 'options' => fox_thumbnail_support(),
                'std' => 'thumbnail-large',
            ],
            'excerpt_more_style' => [
                'std' => 'btn'
            ],
        ],

        'section' => 'bigpost',
        'section_title' => 'Big Post',
    ]);

    /* Small Posts
    ------------------------------------ */
    $params += fox_generate_options([
        'base' => 'grid',
        'prefix' => 'small_posts_',
        'context' => 'elementor',

        'exclude' => [
            'first_standard',
            'item_card',
            'item_border',
            'item_border_color',
            'column',
            'item_spacing',
            'item_align',
            'text_color',
            
            'thumbnail_heading',
            'title_heading',
            'thumbnail_type',
        ],

        'override' => [
            'title_size' => [
                'std' => 'small',
            ],
            'excerpt_length' => [
                'std' => 12,
            ],
            'excerpt_size' => [
                'std' => 'small',
            ],
            'excerpt_more' => [
                'std' => 'no',
            ],
            'excerpt_more_style' => [
                'std' => 'simple',
            ],
            'thumbnail' => [
                'std' => 'landscape',
            ],
            'thumbnail_position' => [
                'std' => 'right',
                'title' => 'Thumbnail Position',
            ],
            'thumbnail_width' => [
                'title' => 'Thumbnail Width',
            ],
            'thumbnail_placeholder' => [
                'std' => 'no',
            ],
            'list_spacing' => [
                'std' => 'small',
            ],
            'list_mobile_layout' => [
                'title' => 'Layout on mobile',
                'std' => 'list',
            ],
            'show_category' => [
                'std' => '',
            ],
        ],

        'section' => 'smallposts',
        'section_title' => 'Small Posts',
    ]);
    
    return apply_filters( 'fox_params', $params, 'post_group1' );
    
}

function fox_post_group2_params() {

    $params = foxele_query_params();

    /* General
    ------------------------------------ */
    $params[ 'columns_order' ] = array(
        'type' => 'select',
        'title' => 'Columns Order',
        'options' => array(
            '1a-1b-3'  => 'Big / Medium / Small posts',
            '1b-1a-3'  => 'Medium / Big / Small posts',

            '1a-3-1b'  => 'Big / Small posts / Medium',
            '1b-3-1a'  => 'Medium / Small posts / Big',

            '3-1a-1b'  => 'Small posts / Big / Medium',
            '3-1b-1a'  => 'Small posts / Medium / Big',
        ),
        'std' => '1a-3-1b',

        'section' => 'layout',
        'section_title' => 'Layout',
    );

    $params[ 'text_color' ] = array(
        'type' => 'color',
        'title' => 'Custom Text Color',
    );

    $params[ 'sep_border' ] = array(
        'type' => 'switcher',
        'std' => '',
        'title' => 'Border between columns',
    );

    $params[ 'sep_border_color' ] = array(
        'type' => 'color',
        'title' => 'Border color',
    );

    /* Big Post
    ------------------------------------ */
    $params += fox_generate_options([
        'base' => 'grid',
        'prefix' => 'bigpost_',
        'context' => 'elementor',

        'exclude' => [
            'first_standard',
            'item_card',
            'column',
            'item_spacing',
            'item_border',
            'item_border_color',
            'text_color',
            'list_sep',
            'list_sep_style',
            'list_sep_color',
            'list_spacing',
            'list_valign',
            'thumbnail_index',
            'thumbnail_position',
            'thumbnail_width',
            'list_mobile_layout',
            'thumbnail_placeholder',
            
            'thumbnail_heading',
            'title_heading',
        ],

        'append' => [

            'thumbnail_type' => [
                'title' => 'Thumbnail Type',
                'type' => 'select',
                'options' => [
                    'advanced' => 'Full slider, video etc',
                    'simple' => 'Just simple image thumbnail',
                ],
                'std' => 'simple',
                'after' => 'show_thumbnail',
            ],
            
            'thumbnail_caption' => [
                'title' => 'Thumbnail caption?',
                'type' => 'switcher',
                'std' => '',
                'after' => 'show_thumbnail',
            ],
            
            'thumbnail_order' => [
                'title' => 'Thumbnail/Text order',
                'type' => 'select',
                'options' => [
                    'before' => 'Before content',
                    'after' => 'After content',
                ],
                'std' => 'before',
                'after' => 'show_thumbnail',
            ],

        ],

        'override' => [
            'title_size' => [
                'std' => 'medium',
            ],
            'item_align' => [
                'title' => 'Item alignment',
                'std' => 'center',
            ],
            'thumbnail' => [
                /*
                'options' => [
                    'thumbnail-large' => 'Large (720x480)',
                    'large' => 'Large original ratio',
                    'custom' => 'Custom',
                ],
                */
                'std' => 'thumbnail-large',
            ],
            'excerpt_more_style' => [
                'std' => 'btn'
            ],
        ],

        'section' => 'bigpost',
        'section_title' => 'Big Post',
    ]);

    /* Medium Post
    ------------------------------------ */
    $params += fox_generate_options([
        'base' => 'grid',
        'prefix' => 'medium_post_',
        'context' => 'elementor',

        'exclude' => [
            'first_standard',
            'item_card',
            'column',
            'item_spacing',
            'item_border',
            'item_border_color',
            'text_color',
            'list_sep',
            'list_sep_style',
            'list_sep_color',
            'list_spacing',
            'list_valign',
            'thumbnail_index',
            'thumbnail_position',
            'thumbnail_width',
            'list_mobile_layout',
            'thumbnail_placeholder',
            
            'thumbnail_heading',
            'title_heading',
        ],

        'override' => [
            'item_align' => [
                'title' => 'Item alignment',
            ],
            'title_size' => [
                'std' => 'small',
            ],
            'excerpt_length' => [
                'std' => 32,
            ],
            'show_category' => [
                'std' => '',
            ],
            'thumbnail' => [
                /*
                'options' => [
                    'landscape' => 'Landscape',
                    'square' => 'Square',
                    'portrait' => 'Portrait',

                    'medium' => 'Medium',
                    'large' => 'Large',
                    'custom' => 'Custom',
                ],
                */
                'std' => 'medium',
            ],
        ],
        
        'append' => [
            'thumbnail_order' => [
                'title' => 'Thumbnail/Text order',
                'type' => 'select',
                'options' => [
                    'before' => 'Before content',
                    'after' => 'After content',
                ],
                'std' => 'before',
                'after' => 'show_thumbnail',
            ],
        ],

        'section' => 'medium_post',
        'section_title' => 'Medium Post',
    ]);

    /* Small Posts
    ------------------------------------ */
    $params += fox_generate_options([
        'base' => 'grid',
        'prefix' => 'small_posts_',
        'context' => 'elementor',

        'exclude' => [
            'first_standard',
            'item_card',
            'column',
            'item_spacing',
            'item_border',
            'item_border_color',
            'text_color',
            'list_sep',
            'list_sep_style',
            'list_sep_color',
            'list_spacing',
            'list_valign',
            'thumbnail_index',
            'thumbnail_position',
            'thumbnail_width',
            'list_mobile_layout',
            'thumbnail_placeholder',
            
            'thumbnail_heading',
            'title_heading',
        ],

        'override' => [
            'item_align' => [
                'title' => 'Item alignment',
            ],
            'title_size' => [
                'std' => 'tiny',
            ],
            'show_excerpt' => [
                'std' => '',
            ],
            'excerpt_length' => [
                'std' => 12,
            ],
            'excerpt_more' => [
                'std' => '',
            ],
            'show_category' => [
                'std' => '',
            ],
            'thumbnail' => [
                /*
                'options' => [
                    'landscape' => 'Landscape',
                    'square' => 'Square',
                    'portrait' => 'Portrait',

                    'medium' => 'Medium',
                    'large' => 'Large',
                    'custom' => 'Custom',
                ],
                */
                'std' => 'landscape',
            ],
        ],
        
        'append' => [
            'thumbnail_order' => [
                'title' => 'Thumbnail/Text order',
                'type' => 'select',
                'options' => [
                    'before' => 'Before content',
                    'after' => 'After content',
                ],
                'std' => 'before',
                'after' => 'show_thumbnail',
            ],
        ],

        'section' => 'smallposts',
        'section_title' => 'Small Posts',
    ]);
    
    return apply_filters( 'fox_params', $params, 'post_group2' );
    
}

/**
 * Return blog params
 */
function fox_blog_params( $layout = '' ) {
    
    $params = [];
    
    if ( 'grid' == $layout ) {
        
        $params = foxele_query_params();
        $params += fox_generate_options([
            'base' => 'grid',
            'exclude' => [
                'thumbnail_position',
                'thumbnail_width',
                'list_sep',
                'list_sep_style',
                'list_sep_color',
                'list_mobile_layout',
                'list_spacing',
                'list_valign',
            ],
            'override' => [
                'item_spacing' => [
                    'title' => 'Item Spacing'
                ],
                'item_align' => [
                    'title' => 'Item Align',
                ],
            ],
            'append' => [
                'thumbnail_order' => [
                    'title' => 'Thumbnail/Text order',
                    'type' => 'select',
                    'options' => [
                        'before' => 'Before content',
                        'after' => 'After content',
                    ],
                    'std' => 'before',
                    'after' => 'show_thumbnail',
                ],
            ],
            'context' => 'elementor',

            'section' => 'layout',
            'section_title' => 'Layout',
        ]);
        
    }
    
    if ( 'list' == $layout ) {
    
        $params = foxele_query_params();
        $params += fox_generate_options([

            'base' => 'grid',
            'exclude' => [
                'column',
                'item_card',
                'item_spacing',
                'item_align',
                'item_border',
                'item_border_color',
            ],

            'override' => [
                'thumbnail_width' => [
                    'title' => 'Thumbnail Width',
                ],
                'thumbnail_position' => [
                    'title' => 'Thumbnail Position',
                ],
                'list_mobile_layout' => [
                    'title' => 'Mobile Layout',
                ],
            ],
            
            'append' => [
                'list_index' => [
                    'title' => 'Index 1, 2..?',
                    'type' => 'switcher',
                    'std' => '',
                    'after' => 'list_valign',
                ],
                
                'thumbnail_caption' => [
                    'title' => 'Thumbnail caption?',
                    'type' => 'switcher',
                    'std' => '',
                    'after' => 'show_thumbnail',
                ],
            ],

            'context' => 'elementor',
            'section' => 'layout',
            'section_title' => 'Layout',

        ]);
    
    }
    
    if ( 'masonry' == $layout ) {
    
        $params = foxele_query_params();
        $params += fox_generate_options([
            'base' => 'grid',
            'exclude' => [
                
                'first_standard',
                
                'thumbnail_position',
                'thumbnail_width',
                'list_mobile_layout',
                'list_sep',
                'list_sep_style',
                'list_sep_color',
                'list_spacing',
                'list_valign',

                'thumbnail', 
                'thumbnail_custom',
                'thumbnail_placeholder',
            ],
            'override' => [
                'item_spacing' => [
                    'title' => 'Item Spacing'
                ],
                'item_align' => [
                    'title' => 'Item Align',
                ],
            ],
            'append' => [
                'big_first_post' => [
                    'title' => 'Big first post',
                    'type' => 'switcher',
                    'std' => 'yes',
                    'after' => 'column',
                ],
            ],
            'context' => 'elementor',

            'section' => 'layout',
            'section_title' => 'Layout',
        ]);
    
    }
    
    if ( 'newspaper' == $layout ) {
    
        $params = foxele_query_params();
        $params += fox_generate_options([
            'base' => 'standard',
            'context' => 'elementor',

            'override' => [
                'thumbnail_type' => [
                    'std' => 'simple',
                ]
            ],

            'section' => 'layout',
            'section_title' => 'Layout',
        ]);
    
    }
    
    if ( 'standard' == $layout ) {
    
        $params = foxele_query_params();
        $params += fox_generate_options([
            'base' => 'standard',
            'context' => 'elementor',

            'section' => 'layout',
            'section_title' => 'Layout',
        ]);
    
    }
    
    if ( 'vertical' == $layout ) {
    
        $params = foxele_query_params();
        $params += fox_generate_options([

            'base' => 'grid',
            'exclude' => [
                'first_standard',
                'item_card',
                'item_border',
                'item_border_color',
                'list_sep',
                'list_sep_style',
                'list_sep_color',
                
                'column',
                'item_spacing',
                'item_align',
                'list_spacing',
                'list_valign',
                // 'thumbnail',
                'thumbnail_custom',
                'thumbnail_width',
                'thumbnail_placeholder',
                'thumbnail_shape',
                'list_mobile_layout',
                // 'title_size',
            ],
            'override' => [
                'thumbnail_position' => [
                    'title' => 'Thumbnail Position',
                ],
                'thumbnail' => [
                    /*
                    'options' => [
                        'landscape' => 'Landscape',
                        'square' => 'Square',
                        'portrait' => 'Portrait',
                        'large' => 'Original (No Crop)',
                        'custom' => 'Custom',
                    ],
                    */
                    'std' => 'large',
                ],
            ],

            'append' => [
                'thumbnail_type' => array (
                    'title' => 'Thumbnail type',
                    'type' => 'select',
                    'options' => [
                        'advanced' => 'Full slider, video etc',
                        'simple' => 'Just simple image thumbnail',
                    ],
                    'std' => 'simple',
                    'after' => 'show_thumbnail',
                ),
            ],

            'context' => 'elementor',
            'section' => 'layout',
            'section_title' => 'Layout',

        ]);
    
    }
    
    if ( 'big' == $layout ) {
    
        $params = foxele_query_params();
        $params += fox_generate_options([
            'base' => 'standard',
            'context' => 'elementor',

            'exclude' => [
                'header_align', 
                'thumbnail_type',
                'show_thumbnail',
                'show_share',
                'show_related'
            ],

            'override' => [
                'show_author' => [
                    'std' => '',
                ],
            ],

            'append' => [
                
                'thumbnail' => [
                    'type' => 'select',
                    'title' => 'Thumbnail',
                    'std' => 'original',
                    'after' => 'thumbnail_shape',
                    'options' => [
                        'original' => 'Original Size',
                        'large' => 'Large',
                        'custom' => 'Custom',
                    ],
                ],

                'thumbnail_custom' => [
                    'type' => 'text',
                    'title' => 'Custom Size (Eg. 425x360)',
                ],

                'title_size' => [
                    'type'  => 'select',
                    'title' => 'Title size',
                    'options' => [
                        'extra' => 'Extra',
                        'large' => 'Large',
                        'medium' => 'Medium',
                    ],
                    'std' => 'extra',
                    'after' => 'show_title',
                ],
                
                'show_excerpt' => [
                    'type' => 'switcher',
                    'title' => 'Show content/excerpt',
                    'std' => 'yes',
                ],
                
                'excerpt_length' => [
                    'title' => 'Excerpt length',
                    'type' => 'text',
                    'std'   => '-1',
                ],

                'meta_background' => [
                    'type'  => 'color',
                    'title' => 'Meta Background',
                    'after' => 'text_color',
                ],

                'item_align' => [
                    'type'  => 'select',
                    'title' => 'Item Align',
                    'options' => [
                        '' => 'Default',
                        'left' => 'Left',
                        'center' => 'Center',
                        'right' => 'Right',
                    ],
                    'std' => '',
                ],

            ],

            'section' => 'layout',
            'section_title' => 'Layout',
        ]);
    
    }
    
    if ( 'slider' == $layout ) {
    
        $params = foxele_query_params( [ 'pagination' ] );

        $params[ 'slider_size' ] = [
            'type' => 'text',
            'std' => '1080x540',
            'title' => 'Slider Size (Eg. 1080x540)',

            'section' => 'layout',
            'section_title' => 'Layout',
        ];

        $params[ 'nav_style' ] = [
            'type' => 'select',
            'std' => 'text',
            'title' => 'Nav Arrow Style',
            'options' => [
                'text' => 'Text',
                'arrow' => 'Arrow',
            ],
        ];

        $params[ 'slider_effect' ] = [
            'type' => 'select',
            'std' => 'slide',
            'title' => 'Slider Effect',
            'options' => [
                'slide' => 'Slide',
                'fade' => 'Fade',
            ],
        ];
        
        $params[ 'slider_autoplay' ] = [
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Autoplay',
        ];

        $params[ 'item_align' ] = array(
            'title' => 'Text Alignment',
            'type' => 'select',
            'options' => array(
                'left' => 'Left',
                'center' => 'Center',
                'right' => 'Right',
            ),
            'std' => 'left',
        );

        /* @todo
        $params[ 'text_background' ] = array(
            'title' => 'Text background',
            'type' => 'color',
        );

        $params[ 'text_color' ] = array(
            'title' => 'Text Color',
            'type' => 'color',
        );
        */

        /* Title
         * ------------------------ */
        $params[ 'placeholder_heading_title' ] = [
            'type' => 'heading',
            'title' => 'Title',
        ];

        $params[ 'show_title' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show title',
        );

        $params[ 'title_background' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Bckground for title?',
        );

        $params[ 'title_tag' ] = array(
            'type' => 'select',
            'options' => [
                'h2' => 'H2',
                'h3' => 'H3',
                'h4' => 'H4',
            ],
            'std' => 'h2',
            'title' => 'Title tag',
        );

        $params[ 'title_size' ] = array(
            'type'  => 'select',
            'std'   => 'large',
            'options' => [
                'tiny' => 'Tiny',
                'small' => 'Small',
                'normal' => 'Normal',
                'medium' => 'Medium',
                'large' => 'Large',
            ],
            'title' => 'Title size',
        );
        
        $params[ 'title_weight' ] = array(
            'type'  => 'select',
            'std'   => '',
            'options' => [
                '' => 'Default',
                '300' => 'Light',
                '400' => 'Normal',
                '700' => 'Bold',
            ],
            'title' => 'Title weight',
        );
        
        $params[ 'title_text_transform' ] = array(
            'type'  => 'select',
            'std'   => '',
            'options' => [
                '' => 'Default',
                'none' => 'None',
                'lowercase' => 'lowercase',
                'uppercase' => 'UPPERCASE',
                'capitalize' => 'Capitalize',
            ],
            'title' => 'Title text transform',
        );

        /* Excerpt
         * ------------------------ */
        $params[ 'placeholder_heading_excerpt' ] = [
            'type' => 'heading',
            'title' => 'Excerpt',
        ];

        $params[ 'show_excerpt' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Display excerpt?',
        );

        $params[ 'excerpt_length' ] = array(
            'type' => 'text',
            'std' => '22',
            'title' => 'Excerpt length',
        );

        $params[ 'excerpt_more' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'More Link',
        );

        /* Other elements
         * ------------------------ */
        $params[ 'placeholder_heading_elements' ] = [
            'type' => 'heading',
            'title' => 'Other elements',
        ];

        $params[ 'show_date' ] = array(
            'type' => 'switcher',
            'std' => 'yes',
            'title' => 'Show post date',
        );

        $params[ 'show_category' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show post categories',
        );

        $params[ 'show_author' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show post author',
        );

        $params[ 'show_view' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show view count',
        );

        $params[ 'show_comment_link' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show comment link',
        );

        $params[ 'show_reading_time' ] = array(
            'type' => 'switcher',
            'std' => '',
            'title' => 'Show reading time',
        );
    
    }
    
    return apply_filters( 'fox_params', $params, $layout );
    
}

/**
 * default blog options to parse
 * @since 4.0
 */
function fox_default_blog_options( $layout ) {
    
    $options = [];
    if ( 'group-1' == $layout ) {
        $params = fox_post_group1_params();
    } elseif ( 'group-2' == $layout ) {
        $params = fox_post_group2_params();
    } else {
        $params = fox_blog_params( $layout );
    }
    
    foreach ( $params as $id => $param ) {
        $options[ $id ] = isset( $param[ 'std' ] ) ? $param[ 'std' ] : '';
    }
    
    // $c_params = fox_customize_params( $layout );
    // to make it compatible with upcoming versions
    // $options = wp_parse_args( $options, $c_params );
    
    return $options;
    
}

add_filter( 'fox_params', 'fox_correct_elementor_params' );
function fox_correct_elementor_params( $params ) {
    
    $sections = [];
    foreach ( $params as $id => $param ) {
    
        // 01 - image to media
        if ( isset( $param[ 'type' ] ) && 'image' == $param[ 'type' ] ) {
            $param[ 'type' ] = 'media';
        }
        $params[ $id ] = $param;
        
        // 02 - section duplication
        if ( isset( $params[ $id ][ 'section' ] ) ) {
            if ( in_array( $params[ $id ][ 'section' ], $sections ) ) {
                unset( $params[ $id ][ 'section' ] );
            } else {
                $sections[] = $params[ $id ][ 'section' ];
            }
        }
        
    }
    
    if ( ! isset( $param[ 'type' ] ) ) {
        echo 'not isset type: ' . $id;
    }
    
    if ( isset( $param[ 'type' ] ) && ! $param[ 'type' ] ) {
        echo 'empty type: ' . $id;
    }
    
    /*
    // additional common params
    $params[ 'misc_heading' ] = array(
        'type' => 'heading',
        'title' => 'Misc',
        
        'section' => 'blog_misc',
        'section_title' => 'Misc',
    );
    
    $params[ 'id' ] = array(
        'type' => 'text',
        'title' => 'Element ID',
        'placeholder' => '',
    );
    
    $params[ 'disable_when_pager' ] = array(
        'type' => 'switcher',
        'title' => 'Disable this block for pages 2, 3..',
        'std' => '',
    );
    */
    
    return $params;
    
}

/* Return fn_params from settings
 * convert Elementor params into fn_params system of theme    
 * return $fn_params
 * @since 4.6.6
------------------------------------------------------------------------------------------------ */
function foxele_fn_params( $settings ) {
    
    $fn_params = $settings;
    
    $fn_params = wp_parse_args( $fn_params, [
        'layout' => '',
        'text_color' => '',
        'item_align' => '',
        'first_standard' => '',
        'item_border' => '',
        'thumbnail_hover_effect' => '',
        'thumbnail_hover_logo' => '',
        'format_indicator' => '',
        'thumbnail_index' => '',
        'thumbnail_view' => '',
        
        'show_thumbnail' => '',
        'show_title' => '',
        'show_date' => '',
        'show_category' => '',
        'show_author' => '',
        'show_author_avatar' => '',
        'show_excerpt' => '',
        'show_excerpt_more' => '',
        'show_comment_link' => '',
        'show_reading_time' => '',
        'show_view' => '',
        
        // masonry
        'big_first_post' => '',
        
        'pagination' => '',
    ]);
    
    /**
     * color
     */
    $fn_params[ 'color' ] = $fn_params[ 'text_color' ];
    
    /**
     * align
     */
    $fn_params[ 'align' ] = $fn_params[ 'item_align' ];

    /**
     * first standard
     */
    $fn_params[ 'first_standard' ] = ( 'yes' == $fn_params[ 'first_standard' ] );

    /**
     * item border
     */
    $fn_params[ 'item_border' ] = ( 'yes' == $fn_params[ 'item_border' ] );

    /**
     * components
     */
    $components = [];
    $possible_components = [
        'thumbnail',
        'title',
        'date',
        'category',
        'author',
        'author_avatar',
        'excerpt', 
        'excerpt_more', 
        'reading_time',
        'comment_link',
        'view',
    ];
    foreach ( $possible_components as $com ) {

        $key = 'show_' . $com;
        if ( 'excerpt_more' == $com ) {
            $key = 'excerpt_more';
        }

        if ( isset( $settings[ $key ] ) && 'yes' == $fn_params[ $key ] ) {
            $components[] = $com;
        }
    }
    
    /**
     * BIG
     */
    if ( 'big' == $fn_params[ 'layout' ] ) {
        $components[] = 'thumbnail';
        $fn_params[ 'big_meta_background' ] = $fn_params[ 'meta_background' ];
        $fn_params[ 'big_align' ] = $fn_params[ 'item_align' ];
        $fn_params[ 'big_content_excerpt' ] = $fn_params[ 'content_excerpt' ];
    }
    
    /**
     * VERTICAL
     */
    if ( 'vertical' == $fn_params['layout']) {
        $fn_params[ 'vertical_thumbnail_type' ] = $fn_params['thumbnail_type'];
        $fn_params[ 'vertical_thumbnail_position' ] = $fn_params['thumbnail_position'];
        $fn_params[ 'vertical_excerpt_size' ] = $fn_params['excerpt_size'];
    }
    
    /**
     * STANDARD
     */
    if ( 'standard' == $fn_params[ 'layout' ] ) {
        
        $fn_params[ 'standard_header_align' ] = $fn_params[ 'header_align' ];
        $fn_params[ 'standard_content_excerpt' ] = $fn_params[ 'content_excerpt' ];
        $fn_params[ 'standard_thumbnail_type' ] = $fn_params[ 'thumbnail_type' ];
        $fn_params[ 'standard_excerpt_length' ] = $fn_params[ 'excerpt_length' ];
        $fn_params[ 'standard_excerpt_more' ] = $fn_params[ 'excerpt_more' ];
        $fn_params[ 'standard_excerpt_more_style' ] = $fn_params[ 'excerpt_more_style' ];
        
        $components[] = 'excerpt';
        
        if ( isset( $settings[ 'show_share' ] ) && 'yes' == $fn_params[ 'show_share' ] ) {
            $components[] = 'share';
        }
        if ( isset( $settings[ 'show_related' ] ) && 'yes' == $fn_params[ 'show_related' ] ) {
            $components[] = 'related';
        }
        
    }
    
    /**
     * NEWSPAPER
     */
    if ( 'newspaper' == $fn_params[ 'layout' ] ) {
        
        $fn_params[ 'newspaper_header_align' ] = $fn_params[ 'header_align' ];
        $fn_params[ 'newspaper_content_excerpt' ] = $fn_params[ 'content_excerpt' ];
        
        $components[] = 'excerpt';
        
        if ( isset( $settings[ 'show_share' ] ) && 'yes' == $fn_params[ 'show_share' ] ) {
            $components[] = 'share';
        }
        if ( isset( $settings[ 'show_related' ] ) && 'yes' == $fn_params[ 'show_related' ] ) {
            $components[] = 'related';
        }
    }
    
    /**
     * SLIDER
     */
    if ( 'slider' == $fn_params[ 'layout' ] ) {
        
        $fn_params[ 'slider_nav_style' ] = $fn_params[ 'nav_style' ];
        if ( 'arrow' == $fn_params[ 'slider_nav_style' ] ) {
            $fn_params[ 'slider_nav_style' ] = 'square-1';
        }
        $fn_params[ 'slider_title_background' ] = $fn_params[ 'title_background' ];
        $components[] = 'thumbnail';
        
    }

    /**
     * FINAL COMPONENTS
     */
    $fn_params[ 'components' ] = join( ',', $components );

    /**
     * thumbnails
     */
    $fn_params[ 'thumbnail_hover' ] = $fn_params[ 'thumbnail_hover_effect' ];

    $thumbnail_hover_logo = wp_parse_args( $fn_params[ 'thumbnail_hover_logo' ], [
        'id' => ''
    ] );
    $fn_params[ 'thumbnail_hover_logo' ] = $thumbnail_hover_logo[ 'id' ];

    /**
     * thumbnail components
     */
    $thumbnail_components = [];
    if ( 'yes' == $fn_params[ 'format_indicator' ] ) {
        $thumbnail_components[] = 'format_indicator';
    }
    if ( 'yes' == $fn_params[ 'thumbnail_index' ] ) {
        $thumbnail_components[] = 'index';
    }
    if ( 'yes' == $fn_params[ 'thumbnail_view' ] ) {
        $thumbnail_components[] = 'view';
    }
    $fn_params[ 'thumbnail_components' ] = join( ',', $thumbnail_components );
    
    /**
     * masonry
     */
    $fn_params[ 'big_first_post' ] = ( 'yes' == $fn_params[ 'big_first_post' ] );
    
    /**
     * list
     */
    
    // change prefix, just a legacy
    if ( 'group-1' == $fn_params[ 'layout' ] ) {
        
        $fn_params[ 'group1_bigpost_ratio' ] = $fn_params[ 'bigpost_ratio' ];
        $fn_params[ 'group1_bigpost_position' ] = $fn_params[ 'bigpost_position' ];
        $fn_params[ 'group1_sep_border' ] = $fn_params[ 'sep_border' ];
        $fn_params[ 'group1_sep_border_color' ] = $fn_params[ 'sep_border_color' ];
        
        // big copy
        $big_copy = [];
        foreach ( $fn_params as $k => $v ) {
            if ( substr( $k, 0, 8 ) == 'bigpost_' ) {
                $big_copy[ substr( $k, 8 ) ] = $v;
            }
        }
        $big_copy[ 'layout' ] = 'grid';
        $big_copy = foxele_fn_params( $big_copy );
        foreach ( $big_copy as $k => $v ) {
            $fn_params[ 'group1_big_' . $k ] = $v;
        }
        
        // small copy
        $small_copy = [];
        foreach ( $fn_params as $k => $v ) {
            if ( substr( $k, 0, 12 ) == 'small_posts_' ) {
                $small_copy[ substr( $k, 12 ) ] = $v;
            }
        }
        $small_copy[ 'layout' ] = 'list';
        $small_copy = foxele_fn_params( $small_copy );
        foreach ( $small_copy as $k => $v ) {
            $fn_params[ 'group1_small_' . $k ] = $v;
        }
        
    }
    
    
    // change prefix, just a legacy
    if ( 'group-2' == $fn_params[ 'layout' ] ) {
        
        $fn_params[ 'group2_columns_order' ] = $fn_params[ 'columns_order' ];
        $fn_params[ 'group2_sep_border' ] = $fn_params[ 'sep_border' ];
        $fn_params[ 'group2_sep_border_color' ] = $fn_params[ 'sep_border_color' ];
        
        // big copy
        $big_copy = [];
        foreach ( $fn_params as $k => $v ) {
            if ( substr( $k, 0, 8 ) == 'bigpost_' ) {
                $big_copy[ substr( $k, 8 ) ] = $v;
            }
        }
        $big_copy[ 'layout' ] = 'grid';
        $big_copy = foxele_fn_params( $big_copy );
        foreach ( $big_copy as $k => $v ) {
            $fn_params[ 'group2_big_' . $k ] = $v;
        }
        
        // medium copy
        $medium_copy = [];
        foreach ( $fn_params as $k => $v ) {
            if ( substr( $k, 0, 12 ) == 'medium_post_' ) {
                $medium_copy[ substr( $k, 12 ) ] = $v;
            }
        }
        $medium_copy[ 'layout' ] = 'grid';
        $medium_copy = foxele_fn_params( $medium_copy );
        foreach ( $medium_copy as $k => $v ) {
            $fn_params[ 'group2_medium_' . $k ] = $v;
        }
        
        // small copy
        $small_copy = [];
        foreach ( $fn_params as $k => $v ) {
            if ( substr( $k, 0, 12 ) == 'small_posts_' ) {
                $small_copy[ substr( $k, 12 ) ] = $v;
            }
        }
        $small_copy[ 'layout' ] = 'grid';
        $small_copy = foxele_fn_params( $small_copy );
        foreach ( $small_copy as $k => $v ) {
            $fn_params[ 'group2_small_' . $k ] = $v;
        }
        
    }
    
    return $fn_params;
    
}