← All changes
|
modules/atomic-widgets/elements/atomic-youtube/atomic-youtube.php
+9
-2
4.1.4
→
4.3.1
View file →
| @@ -6,8 +6,9 @@ | ||
| 6 | 6 | use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control; |
| 7 | 7 | use Elementor\Modules\AtomicWidgets\DynamicTags\Dynamic_Prop_Type; |
| 8 | 8 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base; |
| 9 | 9 | use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Template; |
| 10 | +use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; | |
| 10 | 11 | use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| 11 | 12 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 12 | 13 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type; |
| 13 | 14 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| @@ -39,9 +40,9 @@ | ||
| 39 | 40 | return esc_html__( 'YouTube', 'elementor' ); |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | public function get_keywords() { |
| 43 | - return [ 'ato', 'atom', 'atoms', 'atomic' ]; | |
| 44 | + return [ 'ato', 'atom', 'atoms', 'atomic', 'youtube', 'video', 'embed', 'media' ]; | |
| 44 | 45 | } |
| 45 | 46 | |
| 46 | 47 | public function get_icon() { |
| 47 | 48 | return 'eicon-e-youtube'; |
| @@ -46,8 +47,12 @@ | ||
| 46 | 47 | public function get_icon() { |
| 47 | 48 | return 'eicon-e-youtube'; |
| 48 | 49 | } |
| 49 | 50 | |
| 51 | + public static function get_computed_html_tag( array $settings ): string { | |
| 52 | + return Html_Tag_Computer::compute( $settings, 'div' ); | |
| 53 | + } | |
| 54 | + | |
| 50 | 55 | protected static function define_props_schema(): array { |
| 51 | 56 | return [ |
| 52 | 57 | 'classes' => Classes_Prop_Type::make() |
| 53 | 58 | ->default( [] ), |
| @@ -52,9 +57,10 @@ | ||
| 52 | 57 | 'classes' => Classes_Prop_Type::make() |
| 53 | 58 | ->default( [] ), |
| 54 | 59 | |
| 55 | 60 | 'source' => String_Prop_Type::make() |
| 56 | - ->default( 'https://www.youtube.com/watch?v=XHOmBV4js_E' ), | |
| 61 | + ->default( 'https://www.youtube.com/watch?v=XHOmBV4js_E' ) | |
| 62 | + ->alias( 'url', 'video' ), | |
| 57 | 63 | |
| 58 | 64 | 'start' => String_Prop_Type::make()->meta( Dynamic_Prop_Type::ignore() ), |
| 59 | 65 | 'end' => String_Prop_Type::make()->meta( Dynamic_Prop_Type::ignore() ), |
| 60 | 66 | 'autoplay' => Boolean_Prop_Type::make()->default( false ), |
| @@ -73,8 +79,9 @@ | ||
| 73 | 79 | protected function define_atomic_controls(): array { |
| 74 | 80 | return [ |
| 75 | 81 | Section::make() |
| 76 | 82 | ->set_label( __( 'Content', 'elementor' ) ) |
| 83 | + ->set_id( 'content' ) | |
| 77 | 84 | ->set_items( [ |
| 78 | 85 | Text_Control::bind_to( 'source' ) |
| 79 | 86 | ->set_placeholder( esc_html__( 'Type or paste your URL', 'elementor' ) ) |
| 80 | 87 | ->set_label( esc_html__( 'YouTube URL', 'elementor' ) ), |