HEX
Server: Apache
System: Linux p3plzcpnl507484.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: tvypkwena2lu (5224663)
PHP: 7.2.34
Disabled: NONE
Upload Files
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>
		';

	}

}