File: //home/parhudrw/roflma.it/wp-content/plugins/lesya-plugin/elementor/widgets/video-section-2.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Lesya Video Section 2 Widget.
*
* @since 1.0
*/
class Lesya_Video_Section_Two_Widget extends Widget_Base {
public function get_name() {
return 'lesya-video-section-2';
}
public function get_title() {
return esc_html__( 'Video Section 2', 'lesya-plugin' );
}
public function get_icon() {
return 'eicon-parallax';
}
public function get_categories() {
return [ 'lesya-category' ];
}
/**
* Register widget controls.
*
* @since 1.0
*/
protected function register_controls() {
$this->start_controls_section(
'video_tab',
[
'label' => esc_html__( 'Video', 'lesya-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'link',
[
'label' => esc_html__( 'Video URL', 'lesya-plugin' ),
'label_block' => true,
'type' => Controls_Manager::URL,
'show_external' => true,
]
);
$this->add_control(
'image',
[
'label' => esc_html__( 'Video Image', 'lesya-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->end_controls_section();
}
/**
* Render widget output on the frontend.
*
* @since 1.0
*/
protected function render() {
$settings = $this->get_settings_for_display();
?>
<!-- Video Section Start -->
<?php if ( $settings['image'] ) : $image = wp_get_attachment_image_url( $settings['image']['id'], 'lesya_1920xAuto' ); ?>
<div class="video-section-two" style="background-image: url(<?php echo esc_url( $image ); ?>);">
<a<?php if ( $settings['link'] ) : ?><?php if ( $settings['link']['is_external'] ) : ?> target="_blank"<?php endif; ?><?php if ( $settings['link']['nofollow'] ) : ?> rel="nofollow"<?php endif; ?> href="<?php echo esc_url( $settings['link']['url'] ); ?>"<?php endif; ?> class="mfp-iframe video-play">
<i class="fas fa-play"></i>
</a>
</div>
<?php endif; ?>
<!-- Video Section End -->
<?php
}
/**
* Render widget output in the editor.
*
* Written as a Backbone JavaScript template and used to generate the live preview.
*
* @since 1.0.0
* @access protected
*/
/*protected function content_template() { ?>
<?php }*/
}
Plugin::instance()->widgets_manager->register_widget_type( new Lesya_Video_Section_Two_Widget() );