start_controls_section( 'settings_section', [ 'label' => esc_html__('Settings', 'elementor-addon'), ] ); $this->end_controls_section(); $this->start_controls_section( 'style_section', [ 'label' => esc_html__('Style', 'elementor-addon'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'width', [ 'label' => esc_html__('Width', 'elementor-addon'), 'type' => Controls_Manager::SLIDER, 'default' => [ 'unit' => '%', ], 'size_units' => ['%', 'px', 'em'], 'range' => [ '%' => [ 'min' => 0, 'max' => 100, ], 'px' => [ 'min' => 0, 'max' => 1000, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-product-featured-image' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'max_width', [ 'label' => esc_html__('Max Width', 'elementor-addon'), 'type' => Controls_Manager::SLIDER, 'default' => [ 'unit' => '%', ], 'size_units' => ['%', 'px', 'em'], 'range' => [ '%' => [ 'min' => 0, 'max' => 100, ], 'px' => [ 'min' => 0, 'max' => 1000, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-product-featured-image' => 'max-width: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); } protected function render() { global $post; $settings = $this->get_settings_for_display(); $featured_image_status = get_field('ukryc_obrazek_wyrozniajacy', $post->ID); if ( ! $post ) { return; } if ( $featured_image_status == 1 ) { return; } if ( has_post_thumbnail( $post->ID ) ) { echo get_the_post_thumbnail( $post->ID, 'large', [ 'class' => 'elementor-product-featured-image', 'loading' => 'lazy', ]); } } }