'options' => [
'one' => [
'title' => esc_html__('Default', 'essential-addons-for-elementor-lite'),
'image' => $image_path . 'one.png'
],
'two' => [
'title' => esc_html__('Two', 'essential-addons-for-elementor-lite'),
'image' => $image_path . 'two.png'
],
'three' => [
'title' => esc_html__('Three', 'essential-addons-for-elementor-lite'),
'image' => $image_path . 'three.png'
],
],
'default' => 'one',
'label_block' => true,
'toggle' => false,
'image_choose'=> true,
]
);
}
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',
'eael_post_grid_preset_style' => ['two', 'three'],
]; //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',
'eael_post_grid_preset_style' => ['two', 'three'],
];
if( 'eael-post-block' === $wb->get_name() ){
$eael_show_post_terms_child_condition = [ 'eael_show_post_terms' => 'yes' ];
}
//Only show for "Post Grid" widget
if ( 'eael-post-grid' === $wb->get_name() ) {
$eael_show_post_terms_child_condition['eael_post_grid_preset_style'] = ['two', 'three'];
}
$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 ) && is_array( $object->object_type ) && count( $object->object_type ) ){
foreach( $object->object_type as $object_type ){
if ( ! in_array( $object_type, array_keys( $post_types ) ) ) {
continue;
}
$post_types_tax[ $object_type ][ $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,
'eael_post_grid_preset_style' => ['two', 'three'],
],
]
);
}
$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,
'ai' => [ 'active' => false ],
'default' => esc_html__( '', 'essential-addons-for-elementor-lite' ),
'condition' => [
'eael_show_post_terms' => 'yes',
'eael_post_grid_preset_style' => ['two', 'three'],
],
]
);
$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!' => ['two', 'three'],
],
]
);
$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_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', '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' => '#000BEC',
'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'),
]
);
if ( 'eael-post-carousel' === $wb->get_name() ) {
$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}};',
],
'condition' => [
'eael_post_carousel_item_style!' => 'eael-overlay',
],
]
);
$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',
],
'condition' => [
'eael_post_carousel_item_style!' => 'eael-overlay',
],
]
);
$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',
'condition' => [
'eael_post_carousel_item_style!' => 'eael-overlay',
],
]
);
$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}};',
],
'condition' => [
'eael_post_carousel_item_style!' => 'eael-overlay',
],
]
);
} else {
$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', 'essential-addons-for-elementor-lite'),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'show_load_more' => ['yes', '1', 'true', 'infinity'],
],
]
);
$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();
}
}