<?php
	$widget_id = $this->get_id();
	
	//Get all settings
	$settings = $this->get_settings();

	if(isset($settings['title']) && !empty($settings['title']))
	{		
		if(!isset($settings['html_tag']) OR empty($settings['html_tag']))
		{
			$settings['html_tag'] = 'h1';
		}
		
		$target = '';
		if(!isset($settings['link']) && !empty($settings['link']))
		{
			$target = $slide['link']['is_external'] ? 'target="_blank"' : '';
		}
?>
<<?php echo esc_attr($settings['html_tag']); ?> class="tg_animated_heading" style="background-image: url(<?php echo esc_url($settings['title_bg']['url']); ?>);">

<?php
	if(!isset($settings['link']) && !empty($settings['link']))
	{
?>
	<a class="tg_animated_heading_link" href="<?php echo esc_url($settings['link']['url']); ?>" <?php echo esc_attr($target); ?>>
<?php
	}
?>
		<?php echo $settings['title']; ?>
<?php
	if(!isset($settings['link']) && !empty($settings['link']))
	{
?>
	</a>
<?php
	}
?>
	
</<?php echo esc_attr($settings['html_tag']); ?>>
<?php
	} // End if title is not empty
?>