<?php
/**
 * Optional login link on the maintenance page.
 *
 * @package MacaHold
 *
 * @var bool   $maca_hold_show_login_link
 * @var string $maca_hold_login_link_label
 */

defined( 'ABSPATH' ) || exit;

if ( empty( $maca_hold_show_login_link ) ) {
	return;
}

$maca_hold_login_url        = wp_login_url();
$maca_hold_login_text       = trim( (string) $maca_hold_login_link_label );
$maca_hold_login_show_text  = '' !== $maca_hold_login_text;
$maca_hold_login_aria_label = $maca_hold_login_show_text ? $maca_hold_login_text : __( 'Log in', 'maca-hold' );
$maca_hold_login_class      = 'maca-hold-login-link';

if ( ! $maca_hold_login_show_text ) {
	$maca_hold_login_class .= ' maca-hold-login-link--icon-only';
}
?>
<a
	class="<?php echo esc_attr( $maca_hold_login_class ); ?>"
	href="<?php echo esc_url( $maca_hold_login_url ); ?>"
	aria-label="<?php echo esc_attr( $maca_hold_login_aria_label ); ?>"
>
	<svg class="maca-hold-login-icon" width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
		<path fill="currentColor" d="M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm0 2c-3.31 0-6 1.79-6 4v1h12v-1c0-2.21-2.69-4-6-4z"/>
	</svg>
	<?php if ( $maca_hold_login_show_text ) : ?>
		<span class="maca-hold-login-text"><?php echo esc_html( $maca_hold_login_text ); ?></span>
	<?php endif; ?>
</a>
