PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev1
Elementor Website Builder – more than just a page builder v3.28.0-dev1
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / atomic-widgets / elements / atomic-image / atomic-image.php

atomic-image.php in Elementor Website Builder – more than just a page builder 3.28.0-dev1, at modules/atomic-widgets/elements/atomic-image/atomic-image.php

67 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Image;
3
4 use Elementor\Modules\AtomicWidgets\Controls\Types\Link_Control;
5 use Elementor\Modules\AtomicWidgets\Elements\Has_Template;
6 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
7 use Elementor\Modules\AtomicWidgets\PropTypes\Image_Prop_Type;
8 use Elementor\Modules\AtomicWidgets\PropTypes\Link_Prop_Type;
9 use Elementor\Modules\AtomicWidgets\Controls\Section;
10 use Elementor\Modules\AtomicWidgets\Elements\Atomic_Widget_Base;
11 use Elementor\Modules\AtomicWidgets\Controls\Types\Image_Control;
12 use Elementor\Modules\AtomicWidgets\Image\Placeholder_Image;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit; // Exit if accessed directly.
16 }
17
18 class Atomic_Image extends Atomic_Widget_Base {
19 use Has_Template;
20
21 public static function get_element_type(): string {
22 return 'a-image';
23 }
24
25 public function get_title() {
26 return esc_html__( 'Atomic Image', 'elementor' );
27 }
28
29 public function get_icon() {
30 return 'eicon-e-image';
31 }
32
33 protected static function define_props_schema(): array {
34 return [
35 'classes' => Classes_Prop_Type::make()
36 ->default( [] ),
37
38 'image' => Image_Prop_Type::make()
39 ->default_url( Placeholder_Image::get_placeholder_image() )
40 ->default_size( 'full' ),
41
42 'link' => Link_Prop_Type::make(),
43 ];
44 }
45
46 protected function define_atomic_controls(): array {
47 $content_section = Section::make()
48 ->set_label( esc_html__( 'Content', 'elementor' ) )
49 ->set_items( [
50 Image_Control::bind_to( 'image' ),
51
52 Link_Control::bind_to( 'link' )
53 ->set_placeholder( __( 'Paste URL or type', 'elementor' ) ),
54 ] );
55
56 return [
57 $content_section,
58 ];
59 }
60
61 protected function get_templates(): array {
62 return [
63 'elementor/elements/atomic-image' => __DIR__ . '/atomic-image.html.twig',
64 ];
65 }
66 }
67