Skip to content

Commit

Permalink
Merge pull request #758 from cobicarmel/release/0.10.5
Browse files Browse the repository at this point in the history
Move the `a` tag inside of the `div`
  • Loading branch information
KingYes authored Oct 27, 2016
2 parents 9bb3467 + 2ff1056 commit 285fa06
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions includes/widgets/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,30 +299,29 @@ protected function render() {
if ( ! empty( $link['is_external'] ) ) {
$this->add_render_attribute( 'link', 'target', '_blank' );
}
}

} ?>
<div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
<?php
if ( $link ) : ?>
<a <?php echo $this->get_render_attribute_string( 'link' ); ?>>
<?php endif; ?>
<div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
<?php
<?php endif;
if ( $has_caption ) : ?>
<figure class="wp-caption">
<figure class="wp-caption">
<?php endif;

echo Group_Control_Image_Size::get_attachment_image_html( $settings );

if ( $has_caption ) : ?>
<figcaption class="widget-image-caption wp-caption-text"><?php echo $settings['caption']; ?></figcaption>
<figcaption class="widget-image-caption wp-caption-text"><?php echo $settings['caption']; ?></figcaption>
<?php endif;

if ( $has_caption ) : ?>
</figure>
<?php endif; ?>
</div>
</figure>
<?php
if ( $link ) : ?>
</a>
<?php endif; ?>
</div>
<?php endif;
}

Expand Down Expand Up @@ -356,11 +355,12 @@ protected function _content_template() {
link_url = settings.image.url;
}

#><div class="elementor-image{{ settings.shape ? ' elementor-image-shape-' + settings.shape : '' }}"><#

if ( link_url ) {
#><a href="{{ link_url }}"><#
}

#><div class="elementor-image{{ settings.shape ? ' elementor-image-shape-' + settings.shape : '' }}"><#
var imgClass = '',
hasCaption = '' !== settings.caption;

Expand All @@ -382,10 +382,11 @@ protected function _content_template() {
#></figure><#
}

#></div><#
if ( link_url ) {
#></a><#
#></a><#
}

#></div><#
} #>
<?php
}
Expand Down

0 comments on commit 285fa06

Please sign in to comment.