← All changes
|
modules/atomic-widgets/elements/atomic-image/atomic-image.php
+13
-1
4.1.3
→
4.3.0-beta3
View file →
| @@ -7,8 +7,9 @@ | ||
| 7 | 7 | use Elementor\Modules\AtomicWidgets\PropTypes\Image_Prop_Type; |
| 8 | 8 | use Elementor\Modules\AtomicWidgets\PropTypes\Link_Prop_Type; |
| 9 | 9 | use Elementor\Modules\AtomicWidgets\Controls\Section; |
| 10 | 10 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base; |
| 11 | +use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; | |
| 11 | 12 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 12 | 13 | use Elementor\Modules\AtomicWidgets\Controls\Types\Image_Control; |
| 13 | 14 | use Elementor\Modules\AtomicWidgets\Utils\Image\Placeholder_Image; |
| 14 | 15 | use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| @@ -36,9 +37,9 @@ | ||
| 36 | 37 | return esc_html__( 'Image', 'elementor' ); |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | public function get_keywords() { |
| 40 | - return [ 'ato', 'atom', 'atoms', 'atomic' ]; | |
| 41 | + return [ 'ato', 'atom', 'atoms', 'atomic', 'image', 'photo', 'picture' ]; | |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | public function get_icon() { |
| 44 | 45 | return 'eicon-e-image'; |
| @@ -43,8 +44,18 @@ | ||
| 43 | 44 | public function get_icon() { |
| 44 | 45 | return 'eicon-e-image'; |
| 45 | 46 | } |
| 46 | 47 | |
| 48 | + public static function html_tag_follows_link(): bool { | |
| 49 | + return false; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public static function get_computed_html_tag( array $settings ): string { | |
| 53 | + return Html_Tag_Computer::compute( $settings, 'img', [ | |
| 54 | + Html_Tag_Computer::FOLLOW_LINK_OPTION => static::html_tag_follows_link(), | |
| 55 | + ] ); | |
| 56 | + } | |
| 57 | + | |
| 47 | 58 | protected static function define_props_schema(): array { |
| 48 | 59 | $props = [ |
| 49 | 60 | 'classes' => Classes_Prop_Type::make() |
| 50 | 61 | ->default( [] ), |
| @@ -64,8 +75,9 @@ | ||
| 64 | 75 | protected function define_atomic_controls(): array { |
| 65 | 76 | return [ |
| 66 | 77 | Section::make() |
| 67 | 78 | ->set_label( esc_html__( 'Content', 'elementor' ) ) |
| 79 | + ->set_id( 'content' ) | |
| 68 | 80 | ->set_items( [ |
| 69 | 81 | Image_Control::bind_to( 'image' ) |
| 70 | 82 | ->set_label( __( 'Image', 'elementor' ) ), |
| 71 | 83 | ] ), |