experiments->is_feature_active( 'e_optimized_markup' );
}
protected function register_controls() {
parent::register_controls();
$this->update_control(
'section_image',
[
'label' => esc_html__( 'Site Logo', 'elementor-pro' ),
]
);
$this->update_control(
'image',
[
'label' => esc_html__( 'Site Logo', 'elementor-pro' ),
'type' => Control_Media_Preview::CONTROL_TYPE,
'src' => $this->get_site_logo(),
'dynamic' => [
'default' => Plugin::elementor()->dynamic_tags->tag_data_to_tag_text( null, 'site-logo' ),
],
],
[
'recursive' => true,
]
);
$this->update_control(
'image_size',
[
'separator' => 'before',
'default' => 'full',
]
);
$this->update_control(
'link_to',
[
'options' => [
'none' => esc_html__( 'None', 'elementor-pro' ),
'site_url' => esc_html__( 'Site URL', 'elementor-pro' ),
'custom' => esc_html__( 'Custom URL', 'elementor-pro' ),
'file' => esc_html__( 'Media File', 'elementor-pro' ),
],
'default' => 'site_url',
],
[
'recursive' => true,
]
);
$this->update_control(
'caption_source',
[
'options' => [
'none' => esc_html__( 'None', 'elementor-pro' ),
'attachment' => esc_html__( 'Attachment Caption', 'elementor-pro' ),
],
]
);
$this->remove_control( 'caption' );
$this->add_control(
'change_logo_cta',
[
'type' => Controls_Manager::BUTTON,
'label_block' => true,
'show_label' => false,
'button_type' => 'default elementor-button-center',
'text' => esc_html__( 'Change Site Logo', 'elementor-pro' ),
'event' => 'elementorProSiteLogo:change',
],
[
'position' => [
'of' => 'image',
'type' => 'control',
'at' => 'after',
],
]
);
}
/**
* TODO: Remove this method when Elementor Core 3.11.0 is required.
* Duplicate of render() method from Elementor\Widget_Image class, so it will use the get_link_url() method.
*
* @return void
*/
protected function render() {
$settings = $this->get_settings_for_display();
if ( empty( $settings['image']['url'] ) ) {
return;
}
$has_caption = $this->has_caption( $settings );
$link = $this->get_link_url( $settings );
if ( $link ) {
$this->add_link_attributes( 'link', $link );
if ( Plugin::elementor()->editor->is_edit_mode() ) {
$this->add_render_attribute( 'link', 'class', 'elementor-clickable' );
}
if ( 'file' === $settings['link_to'] ) {
$this->add_lightbox_data_attributes( 'link', $settings['image']['id'], $settings['open_lightbox'] );
}
} ?>