f( 'eael-post-block' === $wb->get_name() ) {
$wb->add_control(
'enable_post_block_image_ratio',
[
'label' => __('Enable Image Ratio', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'no',
'condition' => [
'eael_show_image' => 'yes',
],
]
);
$wb->add_responsive_control(
'post_block_image_ratio',
[
'label' => __('Image Ratio', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0.1,
'max' => 2,
'step' => 0.01,
],
],
'default' => [
'unit' => 'px',
'size' => 0.66,
],
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .eael-entry-thumbnail' => 'padding-bottom: calc({{SIZE}} * 100%);',
],
'condition' => [
'enable_post_block_image_ratio' => 'yes',
'eael_show_image' => 'yes',
],
]
);
$wb->add_control(
'post_block_image_height',
[
'label' => __('Image Height', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 600,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .eael-entry-thumbnail' => 'height: {{SIZE}}{{UNIT}};',
],
'condition' => [
'eael_show_image' => 'yes',
],
]
);
}
if( 'eael-post-grid' === $wb->get_name() ) {
$wb->add_control(
'enable_postgrid_image_ratio',
[
'label' => __('Enable Image Ratio', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'no',
'condition' => [
'eael_show_image' => 'yes',
],
]
);
$wb->add_responsive_control(
'postgrid_image_ratio',
[
'label' => __('Image Ratio', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0.1,
'max' => 2,
'step' => 0.01,
],
],
'default' => [
'unit' => 'px',
'size' => 0.66,
],
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .eael-entry-thumbnail' => 'padding-bottom: calc({{SIZE}} * 100%);',
],
'condition' => [
'enable_postgrid_image_ratio' => 'yes',
'eael_show_image' => 'yes',
],
]
);
$wb->add_responsive_control(
'postgrid_image_height',
[
'label' => __('Image Height', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 600,
'step' => 1,
],
],
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .eael-entry-thumbnail' => 'height: {{SIZE}}{{UNIT}};',
],
'condition' => [
'eael_show_image' => 'yes',
],
]
);
}
}
if ('eael-content-timeline' === $wb->get_name()) {
$wb->add_control(
'eael_show_image_or_icon',
[
'label' => __('Show Circle Image / Icon', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'img' => [
'title' => __('Image', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-image-bold',
],
'icon' => [
'title' => __('Icon', 'essential-addons-for-elementor-lite'),
'icon' => 'fa fa-info',
],
'bullet' => [
'title' => __('Bullet', 'essential-addons-for-elementor-lite'),
'icon' => 'fa fa-circle',
],
],
'default' => 'icon',
'condition' => [
'eael_content_timeline_choose' => 'dynamic',
],
]
);
$wb->add_control(
'eael_icon_image',
[
'label' => esc_html__('Icon Image', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'eael_show_image_or_icon' => 'img',
],
'ai' => [
'active' => false,
],
]
);
$wb->add_control(
'eael_icon_image_size',
[
'label' => esc_html__('Icon Image Size', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => 24,
],
'range' => [
'px' => [
'max' => 60,
],
],
'condition' => [
'eael_show_image_or_icon' => 'img',
],
'selectors' => [
'{{WRAPPER}} .eael-content-timeline-img img' => 'width: {{SIZE}}px;',
'{{WRAPPER}} .eael-horizontal-timeline-item__point-content .eael-elements-icon img' => 'width: {{SIZE}}px;',
],
]
);
$wb->add_control(
'eael_content_timeline_circle_icon_new',
[
'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'),
'fa4compatibility' => 'eael_content_timeline_circle_icon',
'type' => Controls_Manager::ICONS,
'default' => [
'value' => 'fas fa-pencil-alt',
'library' => 'fa-solid',
],
'condition' => [
'eael_content_timeline_choose' => 'dynamic',
'eael_show_image_or_icon' => 'icon',
],
]
);
}
if( 'eael-post-carousel' === $wb->get_name() ) {
$wb->add_control(
'enable_post_carousel_image_ratio',
[
'label' => __('Enable Image Ratio', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => '',
'condition' => [
'eael_show_image' => 'yes',
],
]
);
$wb->add_responsive_control(
'post_carousel_image_ratio',
[
'label' => __('Image Ratio', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0.1,
'max' => 2,
'step' => 0.01,
],
],
'default' => [
'unit' => 'px',
'size' => 0.66,
],
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} div.eael-entry-thumbnail' => 'padding-bottom: calc({{SIZE}} * 100%);height: auto !important;',
],
'condition' => [
'eael_show_image' => 'yes',
'enable_post_carousel_image_ratio' => 'yes',
],
]
);
}
$wb->add_control(
'eael_show_title',
[
'label' => __('Show Title', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
]
);
$wb->add_control(
'title_tag',
[
'label' => __('Title Tag', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SELECT,
'default' => 'h2',
'options' => [
'h1' => __('H1', 'essential-addons-for-elementor-lite'),
'h2' => __('H2', 'essential-addons-for-elementor-lite'),
'h3' => __('H3', 'essential-addons-for-elementor-lite'),
'h4' => __('H4', 'essential-addons-for-elementor-lite'),
'h5' => __('H5', 'essential-addons-for-elementor-lite'),
'h6' => __('H6', 'essential-addons-for-elementor-lite'),
'span' => __('Span', 'essential-addons-for-elementor-lite'),
'p' => __('P', 'essential-addons-for-elementor-lite'),
'div' => __('Div', 'essential-addons-for-elementor-lite'),
],
'condition' => [
'eael_show_title' => 'yes',
],
]
);
if ('eael-post-grid' === $wb->get_name() || 'eael-post-carousel' === $wb->get_name()) {
$wb->add_control(
'eael_title_length',
[
'label' => __('Title Length', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::NUMBER,
'condition' => [
'eael_show_title' => 'yes',
],
]
);
}
if ( 'eael-content-timeline' === $wb->get_name() ) {
$wb->add_control(
'eael_show_image',
[
'label' => __( 'Show Image', 'essential-addons-for-elementor-lite' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'essential-addons-for-elementor-lite' ),
'label_off' => __( 'Hide', 'essential-addons-for-elementor-lite' ),
'return_value' => 'yes',
'default' => '',
'condition' => [
'eael_content_timeline_choose' => 'dynamic',
],
]
);
$wb->add_group_control(
Group_Control_Image_Size::get_type(),
[
'name' => 'image',
'exclude' => [ 'custom' ],
'default' => 'medium',
'condition' => [
'eael_show_image' => 'yes',
'eael_content_timeline_choose' => 'dynamic',
],
]
);
$wb->add_control(
'eael_image_linkable',
[
'label' => __( 'Image Clickable', 'essential-addons-for-elementor-lite' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ),
'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ),
'return_value' => 'yes',
'default' => '',
'condition' => [
'eael_show_image' => 'yes',
'eael_content_timeline_choose' => 'dynamic',
],
]
);
}
$wb->add_control(
'eael_show_excerpt',
[
'label' => __('Show Excerpt', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
]
);
if ('eael-content-timeline' === $wb->get_name()) {
$wb->add_control(
'eael_excerpt_length',
[
'label' => __('Excerpt Words', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::NUMBER,
'default' => 10,
'condition' => [
'eael_show_excerpt' => 'yes',
'eael_content_timeline_choose' => 'dynamic',
],
]
);
$wb->add_control(
'excerpt_expanison_indicator',
[
'label' => esc_html__('Expansion Indicator', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::TEXT,
'dynamic' => [ 'active' => true ],
'label_block' => false,
'default' => esc_html__('...', 'essential-addons-for-elementor-lite'),
'condition' => [
'eael_show_excerpt' => 'yes',
'eael_content_timeline_choose' => 'dynamic',
],
]
);
} else {
$wb->add_control(
'eael_excerpt_length',
[
'label' => __('Excerpt Words', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::NUMBER,
'default' => 10,
'condition' => [
'eael_show_excerpt' => 'yes',
],
]
);
$wb->add_control(
'excerpt_expanison_indicator',
[
'label' => esc_html__('Expansion Indicator', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::TEXT,
'dynamic' => [ 'active' => true ],
'label_block' => false,
'default' => esc_html__('...', 'essential-addons-for-elementor-lite'),
'condition' => [
'eael_show_excerpt' => 'yes',
],
]
);
}
$wb->add_control(
'eael_show_read_more',
[
'label' => __('Show Read More', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
'condition' => [
'eael_content_timeline_choose' => 'dynamic',
],
]
);
$wb->add_control(
'eael_read_more_text',
[
'label' => esc_html__('Label Text', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::TEXT,
'dynamic' => [ 'active' => true ],
'label_block' => false,
'default' => esc_html__('Read More', 'essential-addons-for-elementor-lite'),
'condition' => [
'eael_content_timeline_choose' => 'dynamic',
'eael_show_read_more' => 'yes',
],
]
);
if (
'eael-post-grid' === $wb->get_name()
|| 'eael-post-block' === $wb->get_name()
|| 'eael-post-carousel' === $wb->get_name()
) {
$wb->add_control(
'eael_show_read_more_button',
[
'label' => __('Show Read More Button', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
]
);
$wb->add_control(
'read_more_button_text',
[
'label' => __('Button Text', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::TEXT,
'dynamic' => [ 'active' => true ],
'default' => __('Read More', 'essential-addons-for-elementor-lite'),
'condition' => [
'eael_show_read_more_button' => 'yes',
],
]
);
}
if ( 'eael-post-carousel' === $wb->get_name()
|| 'eael-post-grid' === $wb->get_name()
|| 'eael-post-block' === $wb->get_name()
) {
$eael_show_post_terms_condition = ['eael_show_image' => 'yes']; //Applicable for both elements: Post Carousel and Post Grid
if( 'eael-post-block' === $wb->get_name() ){
$eael_show_post_terms_condition = [];
}
$wb->add_control(
'eael_show_post_terms',
[
'label' => __('Show Post Terms', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'condition' => $eael_show_post_terms_condition,
]
);
$eael_show_post_terms_child_condition = ['eael_show_image' => 'yes', 'eael_show_post_terms' => 'yes'];
if( 'eael-post-block' === $wb->get_name() ){
$eael_show_post_terms_child_condition = [ 'eael_show_post_terms' => 'yes' ];
}
$post_types = ControlsHelper::get_post_types();
unset(
$post_types['post'],
$post_types['page'],
$post_types['product']
);
$taxonomies = get_taxonomies( [], 'objects' );
$post_types_tax = [];
foreach ( $taxonomies as $taxonomy => $object ) {
if ( ! isset( $object->object_type[0] ) || ! in_array( $object->object_type[0], array_keys( $post_types ) ) ) {
continue;
}
$post_types_tax[ $object->object_type[0] ][ $taxonomy ] = $object->label;
}
foreach ( $post_types as $post_type => $post_taxonomies ) {
$wb->add_control(
'eael_' . $post_type . '_terms',
[
'label' => __( 'Show Terms From', 'essential-addons-for-elementor-lite' ),
'type' => Controls_Manager::SELECT,
'options' => isset( $post_types_tax[ $post_type ] ) ? $post_types_tax[ $post_type ] : [],
'default' => isset( $post_types_tax[ $post_type ] ) ? key( $post_types_tax[ $post_type ] ) : '',
'condition' => [
'eael_show_image' => 'yes',
'eael_show_post_terms' => 'yes',
'post_type' => $post_type
],
]
);
}
$wb->add_control(
'eael_post_terms',
[
'label' => __('Show Terms From', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SELECT,
'options' => [
'category' => __('Category', 'essential-addons-for-elementor-lite'),
'tags' => __('Tags', 'essential-addons-for-elementor-lite'),
],
'default' => 'category',
'condition' => [
'eael_show_image' => 'yes',
'eael_show_post_terms' => 'yes',
'post_type' => [ 'post', 'page', 'product', 'by_id', 'source_dynamic' ]
],
]
);
$wb->add_control(
'eael_post_terms_max_length',
[
'label' => __('Max Terms to Show', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SELECT,
'options' => [
1 => __('1', 'essential-addons-for-elementor-lite'),
2 => __('2', 'essential-addons-for-elementor-lite'),
3 => __('3', 'essential-addons-for-elementor-lite'),
],
'default' => 1,
'condition' => $eael_show_post_terms_child_condition,
]
);
if ( 'eael-post-grid' === $wb->get_name() ){
$wb->add_control(
'eael_post_terms_separator',
[
'label' => esc_html__('Terms Separator', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::TEXT,
'label_block' => false,
'default' => esc_html__('', 'essential-addons-for-elementor-lite'),
'condition' => [
'eael_show_post_terms' => 'yes',
],
]
);
$wb->add_control(
'eael_post_terms_on_image_hover',
[
'label' => esc_html__('Show Terms on Image Hover', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
'condition' => [
'eael_show_post_terms' => 'yes',
],
]
);
}
}
if ('eael-post-grid' === $wb->get_name() || 'eael-post-block' === $wb->get_name() || 'eael-post-carousel' === $wb->get_name()) {
$wb->add_control(
'eael_show_meta',
[
'label' => __('Show Meta', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
]
);
$wb->add_control(
'meta_position',
[
'label' => esc_html__('Meta Position', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SELECT,
'default' => 'meta-entry-footer',
'options' => [
'meta-entry-header' => esc_html__('Entry Header', 'essential-addons-for-elementor-lite'),
'meta-entry-footer' => esc_html__('Entry Footer', 'essential-addons-for-elementor-lite'),
],
'condition' => [
'eael_show_meta' => 'yes',
],
]
);
if ( 'eael-post-grid' === $wb->get_name() ){
$wb->add_control(
'eael_show_avatar',
[
'label' => __('Show Avatar', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
'condition' => [
'eael_show_meta' => 'yes',
'eael_post_grid_preset_style' => '',
],
]
);
$wb->add_control(
'eael_show_author',
[
'label' => __('Show Author Name', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
'condition' => [
'eael_show_meta' => 'yes',
'eael_post_grid_preset_style' => '',
],
]
);
// Style two and three has different default values and keeping controls consistant (Avatar and Author).
$wb->add_control(
'eael_show_avatar_two',
[
'label' => __('Show Avatar', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => '',
'condition' => [
'eael_show_meta' => 'yes',
'eael_post_grid_preset_style' => 'two',
],
]
);
// $wb->add_control(
// 'eael_show_avatar_three',
// [
// 'label' => __('Show Avatar', 'essential-addons-for-elementor-lite'),
// 'type' => Controls_Manager::SWITCHER,
// 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
// 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
// 'return_value' => 'yes',
// 'default' => '',
// 'condition' => [
// 'eael_show_meta' => 'yes',
// 'meta_position' => 'meta-entry-footer',
// 'eael_post_grid_preset_style' => 'three',
// ],
// ]
// );
$wb->add_control(
'eael_show_author_two',
[
'label' => __('Show Author Name', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => '',
'condition' => [
'eael_show_meta' => 'yes',
'eael_post_grid_preset_style' => 'two',
],
]
);
$wb->add_control(
'eael_show_author_three',
[
'label' => __('Show Author Name', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
'condition' => [
'eael_show_meta' => 'yes',
'meta_position' => 'meta-entry-footer',
'eael_post_grid_preset_style' => 'three',
],
]
);
}
if ( 'eael-post-grid' !== $wb->get_name() ){
$wb->add_control(
'eael_show_avatar',
[
'label' => __('Show Avatar', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
'condition' => [
'meta_position' => 'meta-entry-footer',
'eael_show_meta' => 'yes',
],
]
);
$wb->add_control(
'eael_show_author',
[
'label' => __('Show Author Name', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
'condition' => [
'eael_show_meta' => 'yes',
],
]
);
}
$wb->add_control(
'eael_show_date',
[
'label' => __('Show Date', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
'return_value' => 'yes',
'default' => 'yes',
'condition' => [
'eael_show_meta' => 'yes',
],
]
);
}
$wb->end_controls_section();
}
public static function terms_style($wb)
{
$wb->start_controls_section(
'section_terms_style',
[
'label' => __('Terms', 'essential-addons-for-elementor-lite'),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'eael_show_post_terms' => 'yes',
],
]
);
$wb->add_control(
'terms_color',
[
'label' => __('Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .post-carousel-categories li a, {{WRAPPER}} .post-carousel-categories li:after' => 'color: {{VALUE}};',
],
]
);
$wb->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'terms_typography',
'label' => __('Typography', 'essential-addons-for-elementor-lite'),
'selector' => '{{WRAPPER}} .post-carousel-categories li a',
]
);
$wb->add_responsive_control(
'terms_color_alignment',
[
'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __('Left', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __('Center', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __('Right', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-right',
],
],
'selectors' => [
'{{WRAPPER}} .post-carousel-categories' => 'text-align: {{VALUE}};',
],
]
);
$wb->add_control(
'terms_spacing',
[
'label' => __('Spacing', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%'],
'selectors' => [
'{{WRAPPER}} .post-carousel-categories li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$wb->end_controls_section();
}
public static function read_more_button_style($wb)
{
if (
'eael-post-grid' === $wb->get_name()
|| 'eael-post-block' === $wb->get_name()
|| 'eael-post-carousel' === $wb->get_name()
|| 'eael-post-list' === $wb->get_name()
|| 'eael-post-timeline' === $wb->get_name()
) {
$wb->start_controls_section(
'eael_section_read_more_btn',
[
'label' => __('Read More Button Style', 'essential-addons-for-elementor-lite'),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'eael_show_read_more_button' => 'yes',
],
]
);
if ('eael-post-grid' === $wb->get_name()) {
$wb->add_responsive_control(
'eael_post_grid_read_more_alignment',
[
'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __('Left', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __('Center', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __('Right', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-right',
],
],
'selectors' => [
'{{WRAPPER}} .eael-post-elements-readmore-btn' => 'text-align: {{VALUE}};',
],
]
);
}
$wb->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'eael_post_read_more_btn_typography',
'selector' => '{{WRAPPER}} .eael-post-elements-readmore-btn',
]
);
$wb->start_controls_tabs('read_more_button_tabs');
$wb->start_controls_tab(
'read_more_button_style_normal',
[
'label' => __('Normal', 'essential-addons-for-elementor-lite'),
]
);
$wb->add_control(
'eael_post_read_more_btn_color',
[
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'default' => '#61ce70',
'selectors' => [
'{{WRAPPER}} .eael-post-elements-readmore-btn' => 'color: {{VALUE}};',
],
]
);
$wb->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'read_more_btn_background',
'label' => __('Background', 'essential-addons-for-elementor-lite'),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .eael-post-elements-readmore-btn',
'exclude' => [
'image',
],
]
);
$wb->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'read_more_btn_border',
'label' => __('Border', 'essential-addons-for-elementor-lite'),
'selector' => '{{WRAPPER}} .eael-post-elements-readmore-btn',
]
);
$wb->add_responsive_control(
'read_more_btn_border_radius',
[
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .eael-post-elements-readmore-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$wb->end_controls_tab();
$wb->start_controls_tab(
'read_more_button_style_hover',
[
'label' => __('Hover', 'essential-addons-for-elementor-lite'),
]
);
$wb->add_control(
'eael_post_read_more_btn_hover_color',
[
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .eael-post-elements-readmore-btn:hover' => 'color: {{VALUE}};',
],
]
);
$wb->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'read_more_btn_hover_background',
'label' => __('Background', 'essential-addons-for-elementor-lite'),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .eael-post-elements-readmore-btn:hover',
'exclude' => [
'image',
],
]
);
$wb->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'read_more_btn_hover_border',
'label' => __('Border', 'essential-addons-for-elementor-lite'),
'selector' => '{{WRAPPER}} .eael-post-elements-readmore-btn:hover',
]
);
$wb->add_responsive_control(
'read_more_btn_border_hover_radius',
[
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .eael-post-elements-readmore-btn:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$wb->end_controls_tab();
$wb->end_controls_tabs();
$wb->add_responsive_control(
'eael_post_read_more_btn_padding',
[
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .eael-post-elements-readmore-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$wb->add_responsive_control(
'read_more_btn_margin',
[
'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .eael-post-elements-readmore-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$wb->end_controls_section();
}
}
/**
* Load More Button Style
*
*/
public static function load_more_button_style($wb)
{
$wb->start_controls_section(
'eael_section_load_more_btn',
[
'label' => __('Load More Button', 'essential-addons-for-elementor-lite'),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'show_load_more' => ['yes', '1', 'true'],
],
]
);
$wb->add_responsive_control(
'eael_post_grid_load_more_btn_padding',
[
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .eael-load-more-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$wb->add_responsive_control(
'eael_post_grid_load_more_btn_margin',
[
'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'selectors' => [
'{{WRAPPER}} .eael-load-more-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$wb->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'eael_post_grid_load_more_btn_typography',
'selector' => '{{WRAPPER}} .eael-load-more-button',
]
);
$wb->start_controls_tabs('eael_post_grid_load_more_btn_tabs');
// Normal State Tab
$wb->start_controls_tab('eael_post_grid_load_more_btn_normal', ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]);
$wb->add_control(
'eael_post_grid_load_more_btn_normal_text_color',
[
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'default' => '#fff',
'selectors' => [
'{{WRAPPER}} .eael-load-more-button' => 'color: {{VALUE}};',
],
]
);
$wb->add_control(
'eael_cta_btn_normal_bg_color',
[
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'default' => '#29d8d8',
'selectors' => [
'{{WRAPPER}} .eael-load-more-button' => 'background: {{VALUE}};',
],
]
);
$wb->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'eael_post_grid_load_more_btn_normal_border',
'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'),
'selector' => '{{WRAPPER}} .eael-load-more-button',
]
);
$wb->add_control(
'eael_post_grid_load_more_btn_border_radius',
[
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .eael-load-more-button' => 'border-radius: {{SIZE}}px;',
],
]
);
$wb->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'eael_post_grid_load_more_btn_shadow',
'selector' => '{{WRAPPER}} .eael-load-more-button',
'separator' => 'before',
]
);
$wb->end_controls_tab();
// Hover State Tab
$wb->start_controls_tab('eael_post_grid_load_more_btn_hover', ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]);
$wb->add_control(
'eael_post_grid_load_more_btn_hover_text_color',
[
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'default' => '#fff',
'selectors' => [
'{{WRAPPER}} .eael-load-more-button:hover' => 'color: {{VALUE}};',
],
]
);
$wb->add_control(
'eael_post_grid_load_more_btn_hover_bg_color',
[
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'default' => '#27bdbd',
'selectors' => [
'{{WRAPPER}} .eael-load-more-button:hover' => 'background: {{VALUE}};',
],
]
);
$wb->add_control(
'eael_post_grid_load_more_btn_hover_border_color',
[
'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .eael-load-more-button:hover' => 'border-color: {{VALUE}};',
],
]
);
$wb->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'eael_post_grid_load_more_btn_hover_shadow',
'selector' => '{{WRAPPER}} .eael-load-more-button:hover',
'separator' => 'before',
]
);
$wb->end_controls_tab();
$wb->end_controls_tabs();
$wb->add_responsive_control(
'eael_post_grid_loadmore_button_alignment',
[
'label' => __('Button Alignment', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'flex-start' => [
'title' => __('Left', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __('Center', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-center',
],
'flex-end' => [
'title' => __('Right', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-text-align-right',
],
],
'default' => 'center',
'selectors' => [
'{{WRAPPER}} .eael-load-more-button-wrap' => 'justify-content: {{VALUE}};',
],
]
);
$wb->end_controls_section();
}
public static function custom_positioning($wb, $prefix, $section_name, $css_selector, $condition = [])
{
$selectors = '{{WRAPPER}} ' . $css_selector;
$wb->start_controls_section(
$prefix . '_section_position',
[
'label' => $section_name,
'tab' => Controls_Manager::TAB_STYLE,
'condition' => $condition,
]
);
$wb->add_control(
$prefix . '_position',
[
'label' => __('Position', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SELECT,
'default' => '',
'options' => [
'' => __('Default', 'essential-addons-for-elementor-lite'),
'absolute' => __('Absolute', 'essential-addons-for-elementor-lite'),
],
'selectors' => [
$selectors => 'position: {{VALUE}}',
],
]
);
$start = is_rtl() ? __('Right', 'essential-addons-for-elementor-lite') : __('Left', 'essential-addons-for-elementor-lite');
$end = !is_rtl() ? __('Right', 'essential-addons-for-elementor-lite') : __('Left', 'essential-addons-for-elementor-lite');
$wb->add_control(
$prefix . '_offset_orientation_h',
[
'label' => __('Horizontal Orientation', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::CHOOSE,
'toggle' => false,
'default' => 'start',
'options' => [
'start' => [
'title' => $start,
'icon' => 'eicon-h-align-left',
],
'end' => [
'title' => $end,
'icon' => 'eicon-h-align-right',
],
],
'classes' => 'elementor-control-start-end',
'render_type' => 'ui',
'condition' => [
$prefix . '_position!' => '',
],
]
);
$wb->add_responsive_control(
$prefix . '_offset_x',
[
'label' => __('Offset', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => -1000,
'max' => 1000,
'step' => 1,
],
'%' => [
'min' => -200,
'max' => 200,
],
'vw' => [
'min' => -200,
'max' => 200,
],
'vh' => [
'min' => -200,
'max' => 200,
],
],
'default' => [
'size' => '0',
],
'size_units' => ['px', '%', 'vw', 'vh'],
'selectors' => [
'body:not(.rtl) ' . $selectors => 'left: {{SIZE}}{{UNIT}}',
'body.rtl ' . $selectors => 'right: {{SIZE}}{{UNIT}}',
],
'condition' => [
$prefix . '_offset_orientation_h!' => 'end',
$prefix . '_position!' => '',
],
]
);
$wb->add_responsive_control(
$prefix . '_offset_x_end',
[
'label' => __('Offset', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => -1000,
'max' => 1000,
'step' => 0.1,
],
'%' => [
'min' => -200,
'max' => 200,
],
'vw' => [
'min' => -200,
'max' => 200,
],
'vh' => [
'min' => -200,
'max' => 200,
],
],
'default' => [
'size' => '0',
],
'size_units' => ['px', '%', 'vw', 'vh'],
'selectors' => [
'body:not(.rtl) ' . $selectors => 'right: {{SIZE}}{{UNIT}}',
'body.rtl ' . $selectors => 'left: {{SIZE}}{{UNIT}}',
],
'condition' => [
$prefix . '_offset_orientation_h' => 'end',
$prefix . '_position!' => '',
],
]
);
$wb->add_control(
$prefix . '_offset_orientation_v',
[
'label' => __('Vertical Orientation', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::CHOOSE,
'toggle' => false,
'default' => 'start',
'options' => [
'start' => [
'title' => __('Top', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-v-align-top',
],
'end' => [
'title' => __('Bottom', 'essential-addons-for-elementor-lite'),
'icon' => 'eicon-v-align-bottom',
],
],
'render_type' => 'ui',
'condition' => [
$prefix . '_position!' => '',
],
]
);
$wb->add_responsive_control(
$prefix . '_offset_y',
[
'label' => __('Offset', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => -1000,
'max' => 1000,
'step' => 1,
],
'%' => [
'min' => -200,
'max' => 200,
],
'vh' => [
'min' => -200,
'max' => 200,
],
'vw' => [
'min' => -200,
'max' => 200,
],
],
'size_units' => ['px', '%', 'vh', 'vw'],
'default' => [
'size' => '0',
],
'selectors' => [
$selectors => 'top: {{SIZE}}{{UNIT}}',
],
'condition' => [
$prefix . '_offset_orientation_v!' => 'end',
$prefix . '_position!' => '',
],
]
);
$wb->add_responsive_control(
$prefix . '_offset_y_end',
[
'label' => __('Offset', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => -1000,
'max' => 1000,
'step' => 1,
],
'%' => [
'min' => -200,
'max' => 200,
],
'vh' => [
'min' => -200,
'max' => 200,
],
'vw' => [
'min' => -200,
'max' => 200,
],
],
'size_units' => ['px', '%', 'vh', 'vw'],
'default' => [
'size' => '0',
],
'selectors' => [
$selectors => 'bottom: {{SIZE}}{{UNIT}}',
],
'condition' => [
$prefix . '_offset_orientation_v' => 'end',
$prefix . '_position!' => '',
],
]
);
$wb->end_controls_section();
}
public function advanced_data_table_source($wb)
{
if (apply_filters('eael/is_plugin_active', 'ninja-tables/ninja-tables.php')) {
$wb->add_control(
'ea_adv_data_table_source_ninja_table_id',
[
'label' => esc_html__('Table ID', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::SELECT,
'options' => ControlsHelper::get_ninja_tables_list(),
'condition' => [
'ea_adv_data_table_source' => 'ninja',
],
]
);
} else {
$wb->add_control(
'ea_adv_data_table_ninja_required',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => __('Ninja Tables is not installed/activated on your site. Please install and activate Ninja Tables first.', 'essential-addons-for-elementor-lite'),
'content_classes' => 'eael-warning',
'condition' => [
'ea_adv_data_table_source' => 'ninja',
],
]
);
}
}
/**
* @since 3.8.2
* @param $source
*
* @return array
*/
public function event_calendar_source($source)
{
if (apply_filters('eael/pro_enabled', false)) {
$source['eventon'] = __('EventON', 'essential-addons-for-elementor-lite');
} else {
$source['eventon'] = __('EventON (Pro) ', 'essential-addons-for-elementor-lite');
}
return $source;
}
public static function nothing_found_style($wb){
$wb->start_controls_section(
'eael_section_nothing_found_style',
[
'label' => __('Not Found Message', 'essential-addons-for-elementor-lite'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$wb->add_control( 'eael_section_nothing_found_note', [
'type' => Controls_Manager::RAW_HTML,
'raw' => __( 'Style the message when no posts are found.', 'essential-addons-for-elementor-lite' ),
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
] );
$wb->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'eael_post_nothing_found_typography',
'selector' => '{{WRAPPER}} .eael-no-posts-found',
]
);
$wb->add_control(
'eael_post_nothing_found_color',
[
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .eael-no-posts-found' => 'color: {{VALUE}};',
],
]
);
$wb->add_control(
'eael_post_nothing_found_bg_color',
[
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .eael-no-posts-found' => 'background-color: {{VALUE}};',
],
]
);
$wb->add_responsive_control(
'eael_post_nothing_found_padding',
[
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', 'em', '%'],
'default' => [
'top' => "25",
'right' => "25",
'bottom' => "25",
'left' => "25",
'isLinked' => true,
],
'selectors' => [
'{{WRAPPER}} .eael-no-posts-found' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$wb->add_control(
'eael_post_nothing_found_alignment',
[
'label' => __( 'Alignment', 'essential-addons-for-elementor-lite' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'essential-addons-for-elementor-lite' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __( 'Center', 'essential-addons-for-elementor-lite' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __( 'Right', 'essential-addons-for-elementor-lite' ),
'icon' => 'eicon-text-align-right',
],
],
'default' => 'center',
'selectors' => [
'{{WRAPPER}} .eael-no-posts-found' => 'text-align: {{VALUE}};',
],
]
);
$wb->end_controls_section();
}
}