public function get_name() { return 'rs-gallery-showcase-widget'; } public function get_title() { return 'Gallery Showcase'; } public function get_icon() { return 'elem_icon vc_image_gallery_icon'; } public function get_script_depends() { } public function get_style_depends() { return array('swiper'); } public function get_categories() { return array('magplus-elementor'); } protected function _register_controls() { $this->start_controls_section( 'gallery_showcase_general_settings', array( 'label' => esc_html__( 'General' , 'magplus-addons' ) ) ); $this->add_control( 'images', array( 'label' => esc_html__( 'Images', 'magplus-addons' ), 'type' => Controls_Manager::GALLERY, 'label_block' => true, ) ); $this->add_group_control( Group_Control_Image_Size::get_type(), array( 'name' => 'thumbnail', 'default' => 'full', ) ); $this->add_group_control( Group_Control_Css_Filter::get_type(), array( 'name' => 'css_filter', 'selector' => '{{WRAPPER}} .tt-post-img img', ) ); } protected function render() { $settings = $this->get_settings(); $images = $settings['images']; $output = ''; if(!empty($images) && is_array($images)) { $output .= '
'; $output .= '
'; foreach ($images as $key => $image) { if(isset($image['id'])) { $output .= '
'; $output .= ''; $output .= 'gallery'; $output .= ''; $output .= '
'; } } $output .= '
'; $output .= ''; $output .= ''; $output .= ''; $output .= '
'; } echo $output; } } Plugin::instance()->widgets_manager->register_widget_type( new RS_Gallery_Showcase_Widget() );