]> _ Git - c6-wordpress.git/commitdiff
wait #7094 @0:10
authorsoufiane <soufiane@cubedesigners.com>
Tue, 24 Sep 2024 10:42:50 +0000 (12:42 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 24 Sep 2024 10:42:50 +0000 (12:42 +0200)
wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php

index f62565be2adf218d5f38202be682fb6d4d05061b..16209a88fcd20c48faefba190097504bf3a89062 100644 (file)
@@ -130,15 +130,14 @@ class HeroBlock extends Widget_Base {
         );
 
         $this->add_control(
-            'url_video',
+            'video',
             [
-                'label' => __('Video embed url', 'cube'),
-                'type' => Controls_Manager::URL,
-                'default' => [
-                    'url' => '',
-                    'is_external' => false,
-                ],
-                'show_external' => false
+                'label' => esc_html__( 'Has video', 'textdomain' ),
+                'type' => \Elementor\Controls_Manager::SWITCHER,
+                'label_on' => esc_html__( 'Yes', 'textdomain' ),
+                'label_off' => esc_html__( 'No', 'textdomain' ),
+                'return_value' => 'yes',
+                'default' => 'no',
             ]
         );
         
@@ -160,7 +159,7 @@ class HeroBlock extends Widget_Base {
         $body_image = $this->get_settings('body_image');
         $cta_text = $this->get_settings('cta_text');
         $cta_link = $this->get_settings('cta_link');
-        $url_video = $this->get_settings('url_video');
+        $video = $this->get_settings('video');
 
         if ( ! empty( $cta_link['url'] ) ) {
             $this->add_render_attribute( 'cta_text', 'href', $cta_link['url'] );
@@ -214,7 +213,7 @@ class HeroBlock extends Widget_Base {
                     <?= wp_get_attachment_image($body_image['id'], 'full', false, ['class' => 'hero-block-body-image']); ?>
                 <?php endif; ?>
 
-                <?php if (!empty($url_video['url'])): ?>
+                <?php if ($video === 'yes'): ?>
                     <div class="hero-block-player-button">
                         <?= \App\svg_image('player', 'svg player-button')->toHtml(); ?>
                     </div>