<?php
/**
 * The template to display entry title.
 *
 * This template can be overridden by copying it to
 * your-child-theme/views/entry/title.php.
 *
 * @param array $args
 *
 * @package MadeByAura\Prime
 * @author  MadeByAura.com
 */

namespace MadeByAura\Prime;

use MadeByAura\Prime\Helpers\Markup;

defined( 'ABSPATH' ) || die();

// Merge incoming `$args` with defaults.
$args = array_replace_recursive(
	[
		'tag'   => 'h3',
		'link'  => true,
		'class' => '',
	],
	$args,
);

// Set CSS classes.
$classes[] = $args['class'];
$classes[] = 'aura-entry-title';
?>

<<?php echo tag_escape( $args['tag'] ); ?> class="<?php Markup::echo_classes( $classes ); ?>">
	<?php if ( $args['link'] ) : ?>
		<a href="<?php the_permalink(); ?>">
	<?php endif; ?>

	<?php the_title(); ?>

	<?php if ( $args['link'] ) : ?>
		</a>
	<?php endif; ?>
</<?php echo tag_escape( $args['tag'] ); ?>>
