add_control( 'image', [ 'label' => __( 'Image', 'awelementor' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ] ); $repeater->add_control( 'link', [ 'label' => __( 'Link', 'awelementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'awelementor' ), ] ); return $repeater; } /** * @param array $item * @param string $key * @return string */ protected function get_item_html(array $item, $key = 'item') { //return print_r($item, true); // $image_url = Group_Control_Image_Size::get_attachment_image_src( $item['image']['id'], $key, $item['image'] ); // return '' . esc_attr( Control_Media::get_image_alt( $item['image'] ) ) . ''; // $this->add_render_attribute($key, 'class', "fa fa-{$item['icon']}"); // $icon_html = "get_render_attribute_string($key)}>"; // return empty($item['link']['url']) // ? $icon_html // : $this->get_link_html($item['link'], "{$key}-link") . $icon_html . '' // ; $has_caption = !empty($item['caption']); $link = $item['link']; $this->add_render_attribute("{$key}-wrapper", 'class', 'elementor-image'); echo "
get_render_attribute_string("{$key}-wrapper")}>"; if ($has_caption) { echo "
"; } if ($link) { echo $this->get_link_html($link, "{$key}-link"); } echo Group_Control_Image_Size::get_attachment_image_html($item); if ($link) { echo ''; } if ($has_caption) { echo "
{$item['caption']}
"; echo '
'; } echo '
'; } }