File: /home/tvypkwena2lu/public_html/wp-content/plugins/widgets/ele-featured-video.php
<?php
/**
* Elementor oEmbed Widget.
*
* Elementor widget that inserts an embbedable content into the page, from any given URL.
*
* @since 1.0.0
*/
class Elementor_FeaturedVideo_Widget extends \Elementor\Widget_Base {
public function get_name() {
return 'ele-featured-video';
}
public function get_title() {
return __( 'Featured Video', 'plugin-name' );
}
public function get_icon() {
return 'eicon-youtube';
}
public function get_categories() {
return [ 'theme-specific-category' ];
}
protected function _register_controls() {
$this->start_controls_section(
'content_section',
[
'label' => __( 'Content', 'plugin-name' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'title',
[
'label' => __( 'Title', 'plugin-name' ),
'type' => \Elementor\Controls_Manager::TEXT,
'input_type' => 'text',
'default' => __( 'Featured', 'plugin-name' ),
]
);
$this->add_control(
'subtitle',
[
'label' => __( 'Sub Title', 'plugin-name' ),
'type' => \Elementor\Controls_Manager::TEXT,
'input_type' => 'text',
'default' => __( 'Video', 'plugin-name' ),
]
);
$this->add_control(
'description',
[
'label' => __( 'Description', 'plugin-name' ),
'type' => \Elementor\Controls_Manager::WYSIWYG,
'default' => __( '', 'plugin-name' ),
]
);
$this->add_control(
'video_url',
[
'label' => __( 'Youtube Video URL', 'plugin-name' ),
'type' => \Elementor\Controls_Manager::TEXT,
'input_type' => 'text',
'default' => __( 'https://www.youtube.com/embed/f5skon6dK-Q', 'plugin-name' ),
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
//$target = $settings['website_link']['is_external'] ? ' target="_blank"' : '';
//$nofollow = $settings['website_link']['nofollow'] ? ' rel="nofollow"' : '';
echo '
<div class="row">
<div class="col-lg-8 offset-lg-2">
<div class="video-title">
<h2>'.($settings['title'] ? $settings['title'] : '' ).' <span>'.($settings['subtitle'] ? $settings['subtitle'] : '' ).'</span></h2>
</div>
<div class="video-blk">
<div class="video-frame">
<iframe width="100%" height="315" src="'.$settings['video_url'].'" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
'.(!empty($settings['description']) ? ('<div class="vid-desc">'.$settings['description'].'</div>') : '').'
</div>
</div>
</div>
';
}
}