-1 ] ); $options = []; foreach ( $posts as $post ) { $options[ $post->ID ] = $post->post_title; } return $options; } protected function get_post_type_options() { $exclude_post_types = ['attachment', 'revision', 'nav_menu_item']; $post_types = get_post_types(['public' => true], 'objects'); $options = []; foreach ($post_types as $post_type => $post_type_obj) { if (!in_array($post_type, $exclude_post_types)) { $taxonomies = get_object_taxonomies($post_type, 'names'); if (!empty($taxonomies)) { $options[$post_type] = $post_type_obj->label; } } } return $options; } protected function get_all_categories() { $cats = get_categories( [ 'hide_empty' => false ] ); $options = []; foreach ( $cats as $cat ) { $options[ $cat->term_id ] = $cat->name; } return $options; } public function get_name() { return 'eel-archive-post'; } public function get_title() { return esc_html__( 'Archive posts', 'easy-elements' ); } public function get_icon() { return 'easyicon easyelIcon-post-grid'; } public function get_categories() { return [ 'easyelements_category' ]; } public function get_keywords() { return [ 'blog', 'grid', 'post', 'news' ]; } public function get_style_depends() { return [ 'eel-archive-post', ]; } protected function register_controls() { $this->start_controls_section( '_section_grid', [ 'label' => esc_html__( 'Posts Settings', 'easy-elements' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'title_trim', [ 'label' => esc_html__( 'Title Trim Words', 'easy-elements' ), 'type' => Controls_Manager::NUMBER, 'default' => 10, 'min' => 1, 'max' => 100, 'description' => esc_html__('Limit number of words in the post title', 'easy-elements'), ] ); $this->add_control( 'show_excerpt', [ 'label' => esc_html__( 'Show Excerpt', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'easy-elements' ), 'label_off' => esc_html__( 'No', 'easy-elements' ), 'default' => 'yes', ] ); $this->add_control( 'excerpt_trim', [ 'label' => esc_html__( 'Excerpt Trim Words', 'easy-elements' ), 'type' => Controls_Manager::NUMBER, 'default' => 20, 'min' => 5, 'max' => 200, 'description' => esc_html__('Limit number of words in the excerpt', 'easy-elements'), 'condition' => [ 'show_excerpt' => 'yes', ] ] ); $this->add_control( 'title_tag', [ 'label' => esc_html__( 'Title HTML Tag', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', ], 'default' => 'h3', ] ); $this->add_control( 'show_thumbnail', [ 'label' => esc_html__( 'Show Thumbnail', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'easy-elements' ), 'label_off' => esc_html__( 'No', 'easy-elements' ), 'default' => 'yes', ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'thumbnail', // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude 'exclude' => ['custom'], 'default' => 'medium', ] ); $this->add_responsive_control( 'image_border_radius', [ 'label' => esc_html__( 'Border Radius', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eel-post-grid-wrap .grid-item img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'post_image_height', [ 'label' => esc_html__( 'Image Height', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, ], 'em' => [ 'min' => 0, 'max' => 50, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel-post-grid-wrap .grid-item img' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'item_alignment', [ 'label' => __( 'Alignment', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'easy-elements' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'easy-elements' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'easy-elements' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => 'left', 'toggle' => true, 'selectors' => [ '{{WRAPPER}} .eel-post-grid-wrap .grid-item' => 'text-align: {{VALUE}};', ], ] ); $this->add_responsive_control( 'columns', [ 'label' => esc_html__( 'Select Columns', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'default' => '4', 'tablet_default' => '3', 'mobile_default' => '2', 'options' => [ '1' => '1 Column', '2' => '2 Columns', '3' => '3 Columns', '4' => '4 Columns', '5' => '5 Columns', '6' => '6 Columns', ], 'selectors' => [ '{{WRAPPER}} .eel-post-grid-wrap' => 'grid-template-columns: repeat({{VALUE}}, 1fr);', ], ] ); $this->add_responsive_control( 'ar_flex_gap', [ 'label' => esc_html__( 'Column Spacing', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], 'em' => [ 'min' => 0, 'max' => 10, ], 'rem' => [ 'min' => 0, 'max' => 10, ], ], 'default' => [ 'unit' => 'px', 'size' => 30, ], 'selectors' => [ '{{WRAPPER}} .eel-post-grid-wrap' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( '_section_grid_query', [ 'label' => esc_html__( 'Query Settings', 'easy-elements' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $is_pro = class_exists( 'Easy_Elements_Pro' ); $this->add_control( 'post_type', [ 'label' => esc_html__( 'Post Type', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'options' => $is_pro ? $this->get_post_type_options() : [ 'post' => 'Post (Pro Only)' ], 'default' => 'post', 'description' => $is_pro ? '' : esc_html__( 'This option is available in Pro version.', 'easy-elements' ), ] ); $options = [ 'category' => esc_html__( 'Category', 'easy-elements' ), 'post' => esc_html__( 'Specific Posts', 'easy-elements' ), 'user' => esc_html__( 'User', 'easy-elements' ), 'userrole' => esc_html__( 'UserRole', 'easy-elements' ), ]; if ( ! apply_filters('easyel/pro_enabled', false) ) { $options['user'] = __('User (Pro)', 'easy-elements'); $options['userrole'] = __('UserRole (Pro)', 'easy-elements'); } $this->add_control( 'source_type', [ 'label' => esc_html__( 'Source Type', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'options' => $options, 'default' => 'category', ] ); if (!apply_filters('easyel/pro_enabled', false)) { $this->add_control( 'easyel_pro_not_available_warning', [ 'label' => sprintf( '%s', esc_html__('Only Available in Pro Version!', 'easy-elements')), 'type' => Controls_Manager::RAW_HTML, 'condition' => [ 'source_type' => ['user','userrole'], ], ] ); } $this->add_control( 'categories', [ 'label' => esc_html__( 'Select Categories', 'easy-elements' ), 'type' => Controls_Manager::SELECT2, 'multiple' => true, 'options' => $this->get_all_categories(), 'label_block' => true, 'condition' => [ 'source_type' => 'category', ], ] ); $this->add_control( 'post__in', [ 'label' => esc_html__( 'Select Specific Posts', 'easy-elements' ), 'type' => $is_pro ? Controls_Manager::SELECT2 : Controls_Manager::SELECT, 'options' => $is_pro ? $this->get_all_posts() : [ '' => esc_html__( 'Pro Version Only', 'easy-elements' ) ], 'multiple' => $is_pro ? true : false, 'label_block' => true, 'description' => $is_pro ? '' : esc_html__( 'This feature is available in the Pro version.', 'easy-elements' ), 'condition' => [ 'source_type' => 'post', ], ] ); $this->add_control( 'exclude_posts', [ 'label' => esc_html__( 'Exclude Posts', 'easy-elements' ), 'type' => $is_pro ? \Elementor\Controls_Manager::SELECT2 : \Elementor\Controls_Manager::SELECT, 'multiple' => $is_pro ? true : false, 'options' => $is_pro ? $this->get_all_posts() : [ '' => esc_html__( 'Pro Version Only', 'easy-elements' ) ], 'label_block' => true, 'description' => $is_pro ? '' : esc_html__( 'This feature is available in the Pro version.', 'easy-elements' ), 'condition' => [ 'source_type!' => 'post', ], ] ); $this->add_control( 'exclude_categories', [ 'label' => esc_html__( 'Exclude Categories', 'easy-elements' ), 'type' => Controls_Manager::SELECT2, 'multiple' => true, 'options' => $this->get_all_categories(), 'label_block' => true, 'condition' => [ 'source_type' => 'category', ], ] ); if ( apply_filters( 'easyel/pro_enabled', false ) ) { do_action( 'easyel/userdata/source/control', $this ); } $this->add_control( 'offset', [ 'label' => esc_html__( 'Offset', 'easy-elements' ), 'type' => Controls_Manager::NUMBER, 'min' => 0, 'max' => 100, 'description' => esc_html__( 'Skip posts from the top of the query.', 'easy-elements' ), ] ); $this->add_control( 'orderby', [ 'label' => esc_html__( 'Order By', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'options' => $is_pro ? [ 'date' => esc_html__( 'Date', 'easy-elements' ), 'title' => esc_html__( 'Title', 'easy-elements' ), 'rand' => esc_html__( 'Random', 'easy-elements' ), 'menu_order' => esc_html__( 'Menu Order', 'easy-elements' ), ] : [ '' => esc_html__( 'Available in Pro version', 'easy-elements' ) ], 'default' => $is_pro ? 'date' : '', 'description' => $is_pro ? '' : esc_html__( 'This option is available in Pro version.', 'easy-elements' ), 'disabled' => ! $is_pro, ] ); $this->add_control( 'order', [ 'label' => esc_html__( 'Order', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'options' => $is_pro ? [ 'DESC' => esc_html__( 'Descending', 'easy-elements' ), 'ASC' => esc_html__( 'Ascending', 'easy-elements' ), ] : [ '' => esc_html__( 'Available in Pro version', 'easy-elements' ) ], 'default' => $is_pro ? 'DESC' : '', 'description' => $is_pro ? '' : esc_html__( 'This option is available in Pro version.', 'easy-elements' ), 'disabled' => ! $is_pro, ] ); $this->end_controls_section(); $this->start_controls_section( '_section_meta', [ 'label' => esc_html__( 'Meta Settings', 'easy-elements' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'show_meta', [ 'label' => esc_html__('Show Meta', 'easy-elements'), 'type' => \Elementor\Controls_Manager::SELECT2, 'multiple' => true, 'options' => [ 'date' => esc_html__('Date', 'easy-elements'), 'author' => esc_html__('Author', 'easy-elements'), 'category' => esc_html__('Category', 'easy-elements'), 'comments' => esc_html__('Comments', 'easy-elements'), 'read_time' => esc_html__('Reading Time', 'easy-elements'), ], 'default' => ['date', 'author'], 'label_block' => true, ] ); $this->add_control( 'show_date_icon', [ 'label' => esc_html__( 'Show Date Icon', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'easy-elements' ), 'label_off' => esc_html__( 'No', 'easy-elements' ), 'default' => 'yes', 'condition' => [ 'show_meta' => 'date', ] ] ); $this->add_control( 'date_icon', [ 'label' => esc_html__( 'Date Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => '', 'library' => 'fa-solid', ], 'condition' => [ 'show_date_icon' => 'yes', 'show_meta' => 'date', ], ] ); $this->add_control( 'show_by_label', [ 'label' => __( 'Show "By" Label', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off' => __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'author_link_enable', [ 'label' => __( 'Author Link', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off' => __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'show_author_icon', [ 'label' => esc_html__( 'Show Author Icon', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'easy-elements' ), 'label_off' => esc_html__( 'No', 'easy-elements' ), 'default' => 'yes', 'condition' => [ 'show_meta' => 'author', ] ] ); $this->add_control( 'author_icon', [ 'label' => esc_html__( 'Author Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => '', 'library' => 'fa-solid', ], 'condition' => [ 'show_author_icon' => 'yes', 'show_meta' => 'author', ], ] ); $this->add_control( 'show_category_icon', [ 'label' => esc_html__( 'Show Category Icon', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'easy-elements' ), 'label_off' => esc_html__( 'No', 'easy-elements' ), 'default' => 'yes', 'condition' => [ 'show_meta' => 'category', ] ] ); $this->add_control( 'category_icon', [ 'label' => esc_html__( 'Category Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => '', 'library' => 'fa-solid', ], 'condition' => [ 'show_category_icon' => 'yes', 'show_meta' => 'category', ], ] ); $this->add_control( 'show_comments_icon', [ 'label' => esc_html__( 'Show Comments Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'easy-elements' ), 'label_off' => esc_html__( 'No', 'easy-elements' ), 'default' => 'yes', 'condition' => [ 'show_meta' => 'comments', ] ] ); $this->add_control( 'comments_icon', [ 'label' => esc_html__( 'Comments Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::ICONS, 'condition' => [ 'show_comments_icon' => 'yes', 'show_meta' => 'comments', ], ] ); $this->add_control( 'show_read_time_icon', [ 'label' => esc_html__('Show Reading Time Icon', 'easy-elements'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', ] ); $this->add_control( 'read_time_icon', [ 'label' => esc_html__('Reading Time Icon', 'easy-elements'), 'type' => \Elementor\Controls_Manager::ICONS, 'condition' => [ 'show_read_time_icon' => 'yes', ], ] ); $this->add_responsive_control( 'meta_icon_offset', [ 'label' => esc_html__( 'Meta Icon Offset (px)', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => -50, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta svg, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta i' => 'top: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'meta_position', [ 'label' => esc_html__( 'Meta Position', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => $is_pro ? 'up_title' : '', 'options' => $is_pro ? [ 'up_title' => esc_html__( 'Up Title', 'easy-elements' ), 'below_title' => esc_html__( 'Below Title', 'easy-elements' ), 'below_content'=> esc_html__( 'Below Content', 'easy-elements' ), ] : [ '' => esc_html__( 'Available in Pro version', 'easy-elements' ) ], 'description' => $is_pro ? '' : esc_html__( 'This option is available in Pro version.', 'easy-elements' ), 'disabled' => ! $is_pro, ] ); $this->add_control( 'eel_separator', [ 'label' => esc_html__( 'Separator Type', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => [ '' => esc_html__( 'None', 'easy-elements' ), 'line' => esc_html__( 'Line', 'easy-elements' ), 'circle' => esc_html__( 'Circle', 'easy-elements' ), ], 'default' => '', ] ); $this->add_control( 'separator_color', [ 'label' => __( 'Separator Color', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel--separator--line li + li::before, {{WRAPPER}} .eel--separator--circle li + li::before' => 'background-color: {{VALUE}};', ], 'condition' => [ 'eel_separator!' => '', ], ] ); $this->add_responsive_control( 'separator_offset', [ 'label' => esc_html__( 'Separator Offset (px)', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => -50, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel--separator--line li + li::before, {{WRAPPER}} .eel--separator--circle li + li::before' => 'top: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'eel_separator!' => '', ], ] ); $this->add_responsive_control( 'meta_margin', [ 'label' => __( 'Margin', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( '_section_button', [ 'label' => esc_html__( 'Button Settings', 'easy-elements' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'show_read_more', [ 'label' => esc_html__( 'Show Read More', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'easy-elements' ), 'label_off' => esc_html__( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'read_more_text', [ 'label' => esc_html__( 'Read More', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'Read More', 'easy-elements' ), 'condition' => [ 'show_read_more' => 'yes', ], ] ); $this->add_control( 'read_more_icon', [ 'label' => esc_html__( 'Read More Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => '', 'library' => 'fa-solid', ], 'condition' => [ 'show_read_more' => 'yes', ], ] ); $this->add_control( 'read_more_icon_position', [ 'label' => esc_html__( 'Icon Position', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'after', 'options' => [ 'before' => esc_html__( 'Before Text', 'easy-elements' ), 'after' => esc_html__( 'After Text', 'easy-elements' ), ], 'condition' => [ 'show_read_more' => 'yes', ], ] ); $this->start_controls_tabs( 'read_more_button_style_tabs' ); // Normal State $this->start_controls_tab( 'button_style_normal', [ 'label' => esc_html__( 'Normal', 'easy-elements' ), ] ); $this->add_control( 'button_text_color', [ 'label' => esc_html__( 'Color', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel--read-more a' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'button_typography', 'selector' => '{{WRAPPER}} .eel--read-more a', ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'eel_btn_background', 'label' => __( 'Button Background', 'easy-elements' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .eel--read-more a', ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'button_border', 'selector' => '{{WRAPPER}} .eel--read-more a', ] ); $this->add_responsive_control( 'button_border_radius', [ 'label' => esc_html__( 'Border Radius', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eel--read-more a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_padding', [ 'label' => esc_html__( 'Padding', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .eel--read-more a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_margin', [ 'label' => esc_html__( 'Margin', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .eel--read-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'button_style_hover', [ 'label' => esc_html__( 'Hover', 'easy-elements' ), ] ); $this->add_control( 'button_text_color_hover', [ 'label' => esc_html__( 'Color', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel--read-more a:hover' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'button_bg_color_hover', [ 'label' => esc_html__( 'Background Color', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel--read-more a:hover' => 'background-color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'button_border_hover', 'selector' => '{{WRAPPER}} .eel--read-more a:hover', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'btn_icon_offset', [ 'label' => esc_html__( 'Icon Offset (Vertical)', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => -50, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel--read-more-icon.after' => 'top: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'show_read_more' => 'yes', ], ] ); $this->add_responsive_control( 'btn_icon_offset_ho', [ 'label' => esc_html__( 'Icon Offset (Horizontal)', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => -50, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel--read-more-icon.after' => 'left: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'show_read_more' => 'yes', ], ] ); $this->end_controls_section(); $this->start_controls_section( '_section_button_icon', [ 'label' => esc_html__( 'Only Icon Button Settings', 'easy-elements' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'only_icon_show', [ 'label' => esc_html__( 'Show Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'easy-elements' ), 'label_off' => esc_html__( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', ] ); if ( $is_pro ) { $this->add_control( 'only_icon', [ 'label' => esc_html__( 'Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => '', 'library' => 'fa-solid', ], ] ); } else { $this->add_control( 'only_icon_message', [ 'type' => \Elementor\Controls_Manager::RAW_HTML, 'raw' => '
' . esc_html__('No posts found.', 'easy-elements') . '
'; return; } echo '