experiments->is_feature_active( 'e_optimized_markup' ); } protected function is_dynamic_content(): bool { return false; } protected function register_controls() { $this->start_controls_section( 'section_layout', [ 'label' => __('Layout', 'pixel-gallery'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); //Global $this->register_grid_controls('orbit'); $this->register_global_height_controls('orbit'); /** * Justified Gallery Controls */ $this->register_justified_gallery_controls(); $this->add_responsive_control( 'content_width', [ 'label' => __('Content Width', 'pixel-gallery'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 200, 'max' => 600, ], ], 'selectors' => [ '{{WRAPPER}} .pg-orbit-content' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->register_title_tag_controls(); $this->register_show_meta_controls(); $this->register_alignment_controls('orbit'); $this->register_thumbnail_size_controls(); //Global Lightbox Controls $this->register_lightbox_controls(); $this->register_link_target_controls(); $this->end_controls_section(); //Repeater $this->start_controls_section( 'section_item_content', [ 'label' => __('Items', 'pixel-gallery'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $repeater = new Repeater(); $repeater->start_controls_tabs('tabs_item_content'); $repeater->start_controls_tab( 'tab_item_content', [ 'label' => esc_html__('Content', 'pixel-gallery'), ] ); $this->register_repeater_media_controls($repeater); $this->register_repeater_title_controls($repeater); $this->register_repeater_meta_controls($repeater); $this->register_repeater_readmore_controls($repeater); $this->register_repeater_custom_url_controls($repeater); $this->register_repeater_hidden_item_controls($repeater); $repeater->end_controls_tab(); $repeater->start_controls_tab( 'tab_item_grid', [ 'label' => esc_html__('Grid', 'pixel-gallery'), ] ); $this->register_repeater_grid_controls($repeater, 'orbit'); $this->register_repeater_item_height_controls($repeater, 'orbit'); $repeater->end_controls_tab(); $repeater->end_controls_tabs(); $this->register_repeater_items_controls($repeater); $this->end_controls_section(); //Style $this->start_controls_section( 'pg_section_style', [ 'label' => esc_html__('Items', 'pixel-gallery'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs('tabs_item_style'); $this->start_controls_tab( 'tab_item_normal', [ 'label' => esc_html__('Normal', 'pixel-gallery'), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'item_background', 'label' => esc_html__('Background', 'pixel-gallery'), 'types' => ['classic', 'gradient'], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams, WordPress.DB.SlowDBQuery -- Intentional bounded query; exclusions/keys are plugin-controlled, not user request input. 'exclude' => ['image'], 'selector' => '{{WRAPPER}} .pg-orbit-item', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'item_border', 'selector' => '{{WRAPPER}} .pg-orbit-item', 'separator' => 'before', ] ); $this->add_responsive_control( 'item_border_radius', [ 'label' => esc_html__('Border Radius', 'pixel-gallery'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .pg-orbit-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'item_padding', [ 'label' => esc_html__('Padding', 'pixel-gallery'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .pg-orbit-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'item_margin', [ 'label' => esc_html__('Margin', 'pixel-gallery'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .pg-orbit-meta' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'item_box_shadow', 'selector' => '{{WRAPPER}} .pg-orbit-item', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_item_hover', [ 'label' => esc_html__('Hover', 'pixel-gallery'), ] ); $this->add_control( 'item_hover_border_color', [ 'label' => esc_html__('Border Color', 'pixel-gallery'), 'type' => Controls_Manager::COLOR, 'condition' => [ 'item_border_border!' => '', ], 'selectors' => [ '{{WRAPPER}} .pg-orbit-item:hover' => 'border-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'item_hover_box_shadow', 'selector' => '{{WRAPPER}} .pg-orbit-item:hover', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_style_content', [ 'label' => esc_html__('Content', 'pixel-gallery'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'content_background', 'label' => esc_html__('Background', 'pixel-gallery'), 'types' => ['classic', 'gradient'], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams, WordPress.DB.SlowDBQuery -- Intentional bounded query; exclusions/keys are plugin-controlled, not user request input. 'exclude' => ['image'], 'selector' => '{{WRAPPER}} .pg-orbit-content', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => 'rgba(13, 59, 84, 0.8)', ], ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'content_border', 'selector' => '{{WRAPPER}} .pg-orbit-content', 'separator' => 'before', ] ); $this->add_responsive_control( 'content_border_radius', [ 'label' => esc_html__('Border Radius', 'pixel-gallery'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .pg-orbit-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'content_padding', [ 'label' => esc_html__('Padding', 'pixel-gallery'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .pg-orbit-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'content_margin', [ 'label' => esc_html__('Margin', 'pixel-gallery'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .pg-orbit-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'content_box_shadow', 'selector' => '{{WRAPPER}} .pg-orbit-content', ] ); $this->end_controls_section(); //Global Title Controls $this->register_title_controls('orbit'); //Global meta Controls $this->register_meta_controls('orbit'); //Global Readmore Controls $this->register_readmore_controls('orbit'); //Clip Path Controls $this->register_clip_path_controls('orbit'); } public function render_items() { $settings = $this->get_settings_for_display(); $id = 'pg-orbit-' . $this->get_id(); $slide_index = 1; foreach ($settings['items'] as $index => $item) : $attr_name = 'grid-item' . $index; $this->add_render_attribute($attr_name, 'class', 'pg-orbit-item pg-item elementor-repeater-item-' . esc_attr($item['_id']), true); /** * Render Video Inject Here * Video Would be work on Media File & Lightbox * @since 1.0.0 */ if ($item['media_type'] == 'video') { $this->render_video_frame($item, $attr_name, $id); } ?>