save
This commit is contained in:
@@ -176,6 +176,17 @@ class Widget_Image_Box extends Widget_Base {
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'link_text',
|
||||
[
|
||||
'label' => esc_html__( 'Link Text', 'elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'condition' => [
|
||||
'link[url]!' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title_size',
|
||||
[
|
||||
@@ -804,6 +815,14 @@ class Widget_Image_Box extends Widget_Base {
|
||||
$html .= sprintf( '<p %1$s>%2$s</p>', $this->get_render_attribute_string( 'description_text' ), $settings['description_text'] );
|
||||
}
|
||||
|
||||
if ( ! Utils::is_empty( $settings['link']['url'] ) ) {
|
||||
$this->add_render_attribute( 'link', 'class', 'elementor-image-box-link' );
|
||||
|
||||
$this->add_inline_editing_attributes( 'description_link' );
|
||||
|
||||
$html .= sprintf( '<a href="%1$s" class="elementor-image-box-link">%2$s</a>', $settings['link']['url'], $settings['link_text'] );
|
||||
}
|
||||
|
||||
$html .= '</div>';
|
||||
}
|
||||
|
||||
@@ -878,6 +897,15 @@ class Widget_Image_Box extends Widget_Base {
|
||||
html += '<p ' + view.getRenderAttributeString( 'description_text' ) + '>' + settings.description_text + '</p>';
|
||||
}
|
||||
|
||||
|
||||
if ( settings.link && settings.link.url && settings.link_text ) {
|
||||
view.addRenderAttribute( 'link', 'class', 'elementor-image-box-link' );
|
||||
|
||||
view.addInlineEditingAttributes( 'description_link' );
|
||||
|
||||
html += '<a class="elementor-image-box-link" href="' + elementor.helpers.sanitizeUrl( settings.link.url ) + '" ' + view.getRenderAttributeString( 'link' ) + '>' + elementor.helpers.sanitize( settings.link_text ) + '</a>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user