𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/kinsley-plugin/elementor/widgets//header-logo.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* kinsley Logo Widget.
*
* @since 1.0
*/
class kinsley_Logo_Image_Widget extends Widget_Base {
public function get_name() {
return 'kinsley-header-logo';
}
public function get_title() {
return esc_html__( 'Header Logo', 'kinsley-plugin' );
}
public function get_icon() {
return 'eicon-parallax';
}
public function get_categories() {
return [ 'onovo-category' ];
}
/**
* Register widget controls.
*
* @since 1.0
*/
protected function register_controls() {
$this->start_controls_section(
'content_tab',
[
'label' => esc_html__( 'Content', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'more_link', [
'label' => esc_html__( 'URL Link', 'kinsley-plugin' ),
'label_block' => true,
'type' => Controls_Manager::URL,
'show_external' => true,
]
);
$this->add_control(
'image',
[
'label' => esc_html__( 'Logo', 'kinsley-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'image_wh',
[
'label' => esc_html__( 'Logo White', 'kinsley-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'alt',
[
'label' => esc_html__( 'Alt Text', 'kinsley-plugin' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'Logo Alt', 'kinsley-plugin' ),
'default' => esc_html__( '', 'kinsley-plugin' ),
]
);
$this->end_controls_section();
}
/**
* Render widget output on the frontend.
*
* @since 1.0
*/
protected function render() {
$settings = $this->get_settings_for_display();
?>
<div class="onovo-logo-image">
<a<?php if ( $settings['more_link'] ) : ?><?php if ( $settings['more_link']['is_external'] ) : ?> target="_blank"<?php endif; ?><?php if ( $settings['more_link']['nofollow'] ) : ?> rel="nofollow"<?php endif; ?> href="<?php echo esc_url( $settings['more_link']['url'] ); ?>"<?php endif; ?>>
<?php if ( $settings['image'] ) : $image = wp_get_attachment_image_url( $settings['image']['id'], 'onovo_800xAuto' ); ?>
<img src="<?php echo esc_url( $image ); ?>" alt="<?php if ( $settings['alt'] ) : ?><?php echo esc_attr( $settings['alt'] ); ?><?php endif; ?>" />
<?php endif; ?>
<?php if ( $settings['image_wh'] ) : $image_wh = wp_get_attachment_image_url( $settings['image_wh']['id'], 'onovo_800xAuto' ); ?>
<img class="logo--white" src="<?php echo esc_url( $image_wh ); ?>" alt="<?php if ( $settings['alt'] ) : ?><?php echo esc_attr( $settings['alt'] ); ?><?php endif; ?>" />
<?php endif; ?>
</a>
</div>
<?php
}
}
Plugin::instance()->widgets_manager->register( new kinsley_Logo_Image_Widget() );