<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
if ( ! isset( $titleTag ) && empty( $titleTag ) ) {
	$titleTag = 'h3';
}

$title_text = '';
if ( ! empty( $titleLength ) ) {
	$title_text = substr( get_the_title(), 0, $titleLength );
	if ( strlen( get_the_title() ) > $titleLength ) {
		$title_text .= '...';
	}
} else {
	$title_text = get_the_title();
}
?>
<<?php echo \EcafeHelper::check_and_validate_html_tag( $titleTag ); ?> class="post-title">
	<?php echo esc_html( $title_text ); ?>
</<?php echo \EcafeHelper::check_and_validate_html_tag( $titleTag ); ?>>
