start_controls_section( 'section_content', [ 'label' => __('Content', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $repeater_fields = $this->get_acf_repeater_fields(); $this->add_control( 'acf_field', [ 'label' => __('ACF Repeater Field', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => $repeater_fields, 'default' => '', ] ); $this->add_control( 'layout', [ 'label' => __('Layout', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'grid', 'options' => [ 'grid' => __('Grid', 'advanced-gallery-repeater-fields-for-acf'), 'list' => __('List', 'advanced-gallery-repeater-fields-for-acf'), 'accordion' => __('Accordion', 'advanced-gallery-repeater-fields-for-acf'), 'tabs' => __('Tabs', 'advanced-gallery-repeater-fields-for-acf'), 'table' => __('Table', 'advanced-gallery-repeater-fields-for-acf'), ], ] ); $this->add_control( 'preview_post_id', [ 'label' => __('Preview Post ID', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::NUMBER, 'description' => __('Enter a Post/Product ID to preview data.', 'advanced-gallery-repeater-fields-for-acf'), ] ); $this->end_controls_section(); // Template Section $this->start_controls_section( 'section_template', [ 'label' => __('Template', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'title_field', [ 'label' => __('Title Field Name', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => 'title', 'description' => __('Sub-field name for title', 'advanced-gallery-repeater-fields-for-acf'), ] ); $this->add_control( 'content_field', [ 'label' => __('Content Field Name', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => 'description', 'description' => __('Sub-field name for content/description', 'advanced-gallery-repeater-fields-for-acf'), ] ); $this->add_control( 'image_field', [ 'label' => __('Image Field Name', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => 'image', 'description' => __('Sub-field name for image (optional)', 'advanced-gallery-repeater-fields-for-acf'), ] ); $this->end_controls_section(); // Layout Settings Section $this->start_controls_section( 'section_layout', [ 'label' => __('Layout Settings', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_responsive_control( 'columns', [ 'label' => __('Columns', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '3', 'tablet_default' => '2', 'mobile_default' => '1', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', ], 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-grid' => 'grid-template-columns: repeat({{VALUE}}, 1fr) !important;', ], 'condition' => [ 'layout' => 'grid', ], ] ); $this->add_responsive_control( 'gap', [ 'label' => __('Gap', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => ['min' => 0, 'max' => 100], ], 'default' => ['size' => 20, 'unit' => 'px'], 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-grid, {{WRAPPER}} .agrfuxd-repeater-list' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'item_layout', [ 'label' => __('Item Layout', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'stacked', 'options' => [ 'stacked' => __('Stacked (Vertical)', 'advanced-gallery-repeater-fields-for-acf'), 'horizontal' => __('Side by Side (Horizontal)', 'advanced-gallery-repeater-fields-for-acf'), 'horizontal-reverse' => __('Side by Side (Image Right)', 'advanced-gallery-repeater-fields-for-acf'), ], 'condition' => [ 'layout' => ['grid', 'list'], ], ] ); $this->add_responsive_control( 'image_width', [ 'label' => __('Image Width', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', '%'], 'range' => [ 'px' => ['min' => 50, 'max' => 500], '%' => ['min' => 10, 'max' => 50], ], 'default' => ['size' => 30, 'unit' => '%'], 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-horizontal .agrfuxd-item-image, {{WRAPPER}} .agrfuxd-item-horizontal-reverse .agrfuxd-item-image' => 'width: {{SIZE}}{{UNIT}}; flex-shrink: 0;', ], 'condition' => [ 'item_layout' => ['horizontal', 'horizontal-reverse'], ], ] ); $this->add_responsive_control( 'vertical_align', [ 'label' => __('Vertical Alignment', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => __('Top', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-v-align-top', ], 'center' => [ 'title' => __('Middle', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-v-align-middle', ], 'flex-end' => [ 'title' => __('Bottom', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-v-align-bottom', ], ], 'default' => 'flex-start', 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-horizontal, {{WRAPPER}} .agrfuxd-item-horizontal-reverse' => 'align-items: {{VALUE}};', ], 'condition' => [ 'item_layout' => ['horizontal', 'horizontal-reverse'], ], ] ); $this->add_control( 'image_position', [ 'label' => __('Image Position', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'top', 'options' => [ 'top' => __('Top', 'advanced-gallery-repeater-fields-for-acf'), 'bottom' => __('Bottom', 'advanced-gallery-repeater-fields-for-acf'), ], 'condition' => [ 'item_layout' => 'stacked', ], ] ); $this->end_controls_section(); // Style Section $this->start_controls_section( 'section_style', [ 'label' => __('Item Style', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'item_background', [ 'label' => __('Background', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-item' => 'background-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'item_padding', [ 'label' => __('Padding', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'default' => [ 'top' => 20, 'right' => 20, 'bottom' => 20, 'left' => 20, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'item_border_radius', [ 'label' => __('Border Radius', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => ['px' => ['min' => 0, 'max' => 30]], 'default' => ['size' => 8, 'unit' => 'px'], 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-item' => 'border-radius: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'item_shadow', 'selector' => '{{WRAPPER}} .agrfuxd-repeater-item', ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'item_border', 'selector' => '{{WRAPPER}} .agrfuxd-repeater-item', ] ); $this->end_controls_section(); // Title Style Section $this->start_controls_section( 'section_title_style', [ 'label' => __('Title Style', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __('Title Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#333333', 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-title, {{WRAPPER}} .agrfuxd-repeater-item h3, {{WRAPPER}} .agrfuxd-accordion-title, {{WRAPPER}} .agrfuxd-tab-title, {{WRAPPER}} .agrfuxd-timeline-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __('Title Typography', 'advanced-gallery-repeater-fields-for-acf'), 'selector' => '{{WRAPPER}} .agrfuxd-item-title, {{WRAPPER}} .agrfuxd-repeater-item h3, {{WRAPPER}} .agrfuxd-accordion-title, {{WRAPPER}} .agrfuxd-tab-title, {{WRAPPER}} .agrfuxd-timeline-title', ] ); $this->add_responsive_control( 'title_spacing', [ 'label' => __('Title Spacing', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => ['min' => 0, 'max' => 50], ], 'default' => ['size' => 10, 'unit' => 'px'], 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-title, {{WRAPPER}} .agrfuxd-repeater-item h3' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'title_align', [ 'label' => __('Title Alignment', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __('Center', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __('Right', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-text-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-title, {{WRAPPER}} .agrfuxd-repeater-item h3' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); // Content Style Section $this->start_controls_section( 'section_content_style', [ 'label' => __('Content Style', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'content_color', [ 'label' => __('Content Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#666666', 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-content, {{WRAPPER}} .agrfuxd-accordion-content, {{WRAPPER}} .agrfuxd-tab-panel, {{WRAPPER}} .agrfuxd-timeline-content' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'label' => __('Content Typography', 'advanced-gallery-repeater-fields-for-acf'), 'selector' => '{{WRAPPER}} .agrfuxd-item-content, {{WRAPPER}} .agrfuxd-accordion-content, {{WRAPPER}} .agrfuxd-tab-panel, {{WRAPPER}} .agrfuxd-timeline-content, {{WRAPPER}} .agrfuxd-repeater-item p', ] ); $this->add_responsive_control( 'content_align', [ 'label' => __('Content Alignment', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __('Center', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __('Right', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __('Justify', 'advanced-gallery-repeater-fields-for-acf'), 'icon' => 'eicon-text-align-justify', ], ], 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-content, {{WRAPPER}} .agrfuxd-accordion-content, {{WRAPPER}} .agrfuxd-tab-panel, {{WRAPPER}} .agrfuxd-repeater-item p' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); // Image Style Section $this->start_controls_section( 'section_image_style', [ 'label' => __('Image Style', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => [ 'layout' => ['grid', 'list'], ], ] ); $this->add_responsive_control( 'image_border_radius', [ 'label' => __('Border Radius', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'default' => [ 'top' => 4, 'right' => 4, 'bottom' => 4, 'left' => 4, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'image_border', 'selector' => '{{WRAPPER}} .agrfuxd-item-image img', ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'image_shadow', 'selector' => '{{WRAPPER}} .agrfuxd-item-image img', ] ); $this->add_control( 'image_object_fit', [ 'label' => __('Object Fit', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'cover', 'options' => [ 'cover' => __('Cover', 'advanced-gallery-repeater-fields-for-acf'), 'contain' => __('Contain', 'advanced-gallery-repeater-fields-for-acf'), 'fill' => __('Fill', 'advanced-gallery-repeater-fields-for-acf'), 'none' => __('None', 'advanced-gallery-repeater-fields-for-acf'), ], 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-image img' => 'object-fit: {{VALUE}};', ], ] ); $this->add_responsive_control( 'image_height', [ 'label' => __('Image Height', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'vh'], 'range' => [ 'px' => ['min' => 50, 'max' => 600], 'vh' => ['min' => 10, 'max' => 100], ], 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-image img' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'image_spacing', [ 'label' => __('Image Spacing', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => ['min' => 0, 'max' => 50], ], 'default' => ['size' => 15, 'unit' => 'px'], 'selectors' => [ '{{WRAPPER}} .agrfuxd-item-stacked .agrfuxd-item-image' => 'margin-bottom: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .agrfuxd-item-horizontal, {{WRAPPER}} .agrfuxd-item-horizontal-reverse' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Table Style Section $this->start_controls_section( 'section_table_style', [ 'label' => __('Table Style', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => [ 'layout' => 'table', ], ] ); $this->add_control( 'table_header_bg', [ 'label' => __('Header Background', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#f8f9fa', 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-table th' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'table_header_color', [ 'label' => __('Header Text Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#333333', 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-table th' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'table_header_typography', 'label' => __('Header Typography', 'advanced-gallery-repeater-fields-for-acf'), 'selector' => '{{WRAPPER}} .agrfuxd-repeater-table th', ] ); $this->add_control( 'table_cell_color', [ 'label' => __('Cell Text Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#666666', 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-table td' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'table_cell_typography', 'label' => __('Cell Typography', 'advanced-gallery-repeater-fields-for-acf'), 'selector' => '{{WRAPPER}} .agrfuxd-repeater-table td', ] ); $this->add_control( 'table_border_color', [ 'label' => __('Border Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#e0e0e0', 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-table th, {{WRAPPER}} .agrfuxd-repeater-table td' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'table_row_hover_bg', [ 'label' => __('Row Hover Background', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#f8f9fa', 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-table tbody tr:hover' => 'background-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'table_cell_padding', [ 'label' => __('Cell Padding', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'default' => [ 'top' => 12, 'right' => 15, 'bottom' => 12, 'left' => 15, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .agrfuxd-repeater-table th, {{WRAPPER}} .agrfuxd-repeater-table td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Accordion Style Section $this->start_controls_section( 'section_accordion_style', [ 'label' => __('Accordion Style', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => [ 'layout' => 'accordion', ], ] ); $this->add_control( 'accordion_header_bg', [ 'label' => __('Header Background', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#f8f9fa', 'selectors' => [ '{{WRAPPER}} .agrfuxd-accordion-header' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'accordion_header_active_bg', [ 'label' => __('Active Header Background', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#e9ecef', 'selectors' => [ '{{WRAPPER}} .agrfuxd-accordion-header.active, {{WRAPPER}} .agrfuxd-accordion-header:hover' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'accordion_header_color', [ 'label' => __('Header Text Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#333333', 'selectors' => [ '{{WRAPPER}} .agrfuxd-accordion-header' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'accordion_header_typography', 'label' => __('Header Typography', 'advanced-gallery-repeater-fields-for-acf'), 'selector' => '{{WRAPPER}} .agrfuxd-accordion-header', ] ); $this->add_control( 'accordion_icon_color', [ 'label' => __('Icon Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#666666', 'selectors' => [ '{{WRAPPER}} .agrfuxd-accordion-icon' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'accordion_border_color', [ 'label' => __('Border Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#e0e0e0', 'selectors' => [ '{{WRAPPER}} .agrfuxd-accordion-item' => 'border-color: {{VALUE}};', '{{WRAPPER}} .agrfuxd-accordion-content' => 'border-top-color: {{VALUE}};', ], ] ); $this->end_controls_section(); // Tabs Style Section $this->start_controls_section( 'section_tabs_style', [ 'label' => __('Tabs Style', 'advanced-gallery-repeater-fields-for-acf'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => [ 'layout' => 'tabs', ], ] ); $this->add_control( 'tabs_nav_bg', [ 'label' => __('Tab Background', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#f8f9fa', 'selectors' => [ '{{WRAPPER}} .agrfuxd-tab-title' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'tabs_nav_active_bg', [ 'label' => __('Active Tab Background', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#3b82f6', 'selectors' => [ '{{WRAPPER}} .agrfuxd-tab-title.active' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'tabs_nav_color', [ 'label' => __('Tab Text Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#333333', 'selectors' => [ '{{WRAPPER}} .agrfuxd-tab-title' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'tabs_nav_active_color', [ 'label' => __('Active Tab Text Color', 'advanced-gallery-repeater-fields-for-acf'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .agrfuxd-tab-title.active' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'tabs_nav_typography', 'label' => __('Tab Typography', 'advanced-gallery-repeater-fields-for-acf'), 'selector' => '{{WRAPPER}} .agrfuxd-tab-title', ] ); $this->end_controls_section(); } private function get_acf_repeater_fields() { $fields = ['' => __('-- Select Field --', 'advanced-gallery-repeater-fields-for-acf')]; if (!function_exists('acf_get_field_groups')) { return $fields; } $field_groups = acf_get_field_groups(); foreach ($field_groups as $group) { $group_fields = acf_get_fields($group['key']); if (!$group_fields) continue; foreach ($group_fields as $field) { if (in_array($field['type'], ['repeater', 'enhanced_repeater'])) { $fields[$field['name']] = $group['title'] . ' - ' . $field['label']; } } } return $fields; } private function get_current_post_id() { $is_editor = \Elementor\Plugin::$instance->editor->is_edit_mode(); // In editor mode, use Elementor's document context if ($is_editor) { $document = \Elementor\Plugin::$instance->documents->get_current(); if ($document) { return $document->get_main_id(); } } // On frontend, prioritize the actual page being viewed // WooCommerce single product page - use queried object if (function_exists('is_product') && is_product()) { $queried_id = get_queried_object_id(); if ($queried_id) { return $queried_id; } // Fallback to global product global $product; if ($product && is_a($product, 'WC_Product')) { return $product->get_id(); } } // Check queried object (works for most single pages/posts) $queried_id = get_queried_object_id(); if ($queried_id) { return $queried_id; } // Try global post global $post; if ($post && isset($post->ID)) { return $post->ID; } return get_the_ID(); } protected function render() { $settings = $this->get_settings_for_display(); $is_editor = \Elementor\Plugin::$instance->editor->is_edit_mode(); // Check if field is selected if (empty($settings['acf_field'])) { if ($is_editor) { echo '
' . esc_html__('Please select an ACF Repeater field.', 'advanced-gallery-repeater-fields-for-acf') . '
' . esc_html__('No data found.', 'advanced-gallery-repeater-fields-for-acf') . '
'; echo 'Post ID: ' . esc_html($post_id) . ' | Field: ' . esc_html($settings['acf_field']) . '
'; echo '' . wp_kses_post($value) . '
'; } } else { echo '' . wp_kses_post($value) . '
'; } } } echo '' . wp_kses_post($value) . '
'; } } } echo '| ' . esc_html(ucwords(str_replace(['_', '-'], ' ', $key))) . ' | '; } echo '
|---|
| ';
if (is_array($value) && isset($value['url'])) {
echo ' | ';
}
echo '
Layout: {{ settings.layout }} | Field: {{ settings.acf_field }}