Last active
October 4, 2019 08:55
-
-
Save andrasguseo/de2df9e78cd8e75db8080fbd4134b8f5 to your computer and use it in GitHub Desktop.
TEC - Template override for the event organizer block to include hotlinks for email phone and organizer name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Block: Event Organizer | |
* | |
* This override will add clickable URLs to the following: | |
* - Event organizer name | |
* - Event organizer phone number | |
* - Event organizer email address | |
* | |
* Place this template file in your own theme / child theme by creating a file at: | |
* [your-theme]/tribe/events/blocks/event-organizer.php | |
* | |
* @version 4.7 | |
* | |
*/ | |
$organizer = $this->attr( 'organizer' ); | |
if ( ! $organizer ) { | |
return; | |
} | |
$phone = tribe_get_organizer_phone( $organizer ); | |
$website = tribe_get_organizer_website_link( $organizer ); | |
$email = tribe_get_organizer_email( $organizer ); | |
$name = tribe_get_organizer_link( $organizer ); | |
?> | |
<div class="tribe-block tribe-block__organizer__details tribe-clearfix"> | |
<div class="tribe-block__organizer__title"> | |
<h3><?php echo $name; ?></h3> | |
</div> | |
<?php if ( ! empty( $phone ) ) : ?> | |
<p class="tribe-block__organizer__phone"><a href="tel:<?php echo esc_html( $phone ); ?>"><?php echo esc_html( $phone ); ?></a></p> | |
<?php endif; ?> | |
<?php if ( ! empty( $website ) ) : ?> | |
<p class="tribe-block__organizer__website"><?php echo $website; ?></p> | |
<?php endif; ?> | |
<?php if ( ! empty( $email ) ) : ?> | |
<p class="tribe-block__organizer__email"><a href="mailto:<?php echo esc_html( $email ); ?>"><?php echo esc_html( $email ); ?></a></p> | |
<?php endif; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment