carhop__carhop-theme__DEV/template-parts/components/cards/member-contact-card.php
2026-03-03 17:12:56 +01:00

46 lines
1.5 KiB
PHP

<?php
$member_id = $args['member_id'];
switch_to_blog(1);
$member_full_name = get_the_title($member_id);
$member_thumbnail = get_field('profile_thumbnail', $member_id);
$member_thumbnail_url = $member_thumbnail['url'] ?? '';
$member_thumbnail_alt = $member_thumbnail['alt'] ?? '';
$member_description = get_field('description', $member_id);
$member_email = get_field('email', $member_id);
restore_current_blog();
?>
<div href="<?php echo $link; ?>" class="member-contact-card">
<div class="member-contact-card__profile-picture">
<?php if ($member_thumbnail_url) : ?>
<img src="<?php echo $member_thumbnail_url; ?>" alt="<?php echo $member_thumbnail_alt; ?>">
<?php else : ?>
<div class="member-contact-card__profile-picture-placeholder"></div>
<?php endif; ?>
</div>
<div class="member-contact-card__infos">
<h3 class="member-contact-card__name"><?php echo $member_full_name; ?></h3>
<?php if ($member_email) : ?>
<a href="mailto:<?php echo $member_email; ?>" class="member-contact-card_email cta cta--classic cta--rounded cta--has-icon cta--mailing">
<div class="cta__icon">
<?php $mail_svg_path = get_template_directory() . '/resources/img/icons/carhop-mail.svg';
if (file_exists($mail_svg_path)) {
echo file_get_contents($mail_svg_path);
} ?>
</div>
Envoyer un email
</a>
<?php endif; ?>
</div>
<div class="member-contact-card__description">
<?php echo $member_description; ?>
</div>
</div>