← All changes
|
modules/atomic-widgets/elements/atomic-youtube/atomic-youtube.php
+2
-20
4.3.0
→
3.35.0-dev2
View file →
| @@ -6,9 +6,8 @@ | ||
| 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; | |
| 11 | 10 | use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| 12 | 11 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 13 | 12 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type; |
| 14 | 13 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| @@ -40,9 +39,9 @@ | ||
| 40 | 39 | return esc_html__( 'YouTube', 'elementor' ); |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | public function get_keywords() { |
| 44 | - return [ 'ato', 'atom', 'atoms', 'atomic', 'youtube', 'video', 'embed', 'media' ]; | |
| 43 | + return [ 'ato', 'atom', 'atoms', 'atomic' ]; | |
| 45 | 44 | } |
| 46 | 45 | |
| 47 | 46 | public function get_icon() { |
| 48 | 47 | return 'eicon-e-youtube'; |
| @@ -47,12 +46,8 @@ | ||
| 47 | 46 | public function get_icon() { |
| 48 | 47 | return 'eicon-e-youtube'; |
| 49 | 48 | } |
| 50 | 49 | |
| 51 | - public static function get_computed_html_tag( array $settings ): string { | |
| 52 | - return Html_Tag_Computer::compute( $settings, 'div' ); | |
| 53 | - } | |
| 54 | - | |
| 55 | 50 | protected static function define_props_schema(): array { |
| 56 | 51 | return [ |
| 57 | 52 | 'classes' => Classes_Prop_Type::make() |
| 58 | 53 | ->default( [] ), |
| @@ -57,10 +52,9 @@ | ||
| 57 | 52 | 'classes' => Classes_Prop_Type::make() |
| 58 | 53 | ->default( [] ), |
| 59 | 54 | |
| 60 | 55 | 'source' => String_Prop_Type::make() |
| 61 | - ->default( 'https://www.youtube.com/watch?v=XHOmBV4js_E' ) | |
| 62 | - ->alias( 'url', 'video' ), | |
| 56 | + ->default( 'https://www.youtube.com/watch?v=XHOmBV4js_E' ), | |
| 63 | 57 | |
| 64 | 58 | 'start' => String_Prop_Type::make()->meta( Dynamic_Prop_Type::ignore() ), |
| 65 | 59 | 'end' => String_Prop_Type::make()->meta( Dynamic_Prop_Type::ignore() ), |
| 66 | 60 | 'autoplay' => Boolean_Prop_Type::make()->default( false ), |
| @@ -79,9 +73,8 @@ | ||
| 79 | 73 | protected function define_atomic_controls(): array { |
| 80 | 74 | return [ |
| 81 | 75 | Section::make() |
| 82 | 76 | ->set_label( __( 'Content', 'elementor' ) ) |
| 83 | - ->set_id( 'content' ) | |
| 84 | 77 | ->set_items( [ |
| 85 | 78 | Text_Control::bind_to( 'source' ) |
| 86 | 79 | ->set_placeholder( esc_html__( 'Type or paste your URL', 'elementor' ) ) |
| 87 | 80 | ->set_label( esc_html__( 'YouTube URL', 'elementor' ) ), |
| @@ -146,17 +139,6 @@ | ||
| 146 | 139 | protected function get_templates(): array { |
| 147 | 140 | return [ |
| 148 | 141 | 'elementor/elements/atomic-youtube' => __DIR__ . '/atomic-youtube.html.twig', |
| 149 | 142 | ]; |
| 150 | - } | |
| 151 | - | |
| 152 | - public function render_markdown(): string { | |
| 153 | - $settings = $this->get_atomic_settings(); | |
| 154 | - $url = $settings['source'] ?? ''; | |
| 155 | - | |
| 156 | - if ( empty( $url ) ) { | |
| 157 | - return ''; | |
| 158 | - } | |
| 159 | - | |
| 160 | - return '[Video](' . esc_url( $url ) . ')'; | |
| 161 | 143 | } |
| 162 | 144 | } |