Skip to content

Instantly share code, notes, and snippets.

@geoffgraham
Created January 24, 2017 01:12
Show Gist options
  • Save geoffgraham/37e54a4582c6b7e1f8e11daa7a5f8e9a to your computer and use it in GitHub Desktop.
Save geoffgraham/37e54a4582c6b7e1f8e11daa7a5f8e9a to your computer and use it in GitHub Desktop.
The Events Calendar 4.4.0.1 // Change Organizer Link to Label
<?php
/**
* Single Event Meta (Organizer) Template
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe-events/modules/meta/organizer.php
*
* @package TribeEventsCalendar
* @version 4.4
*/
$organizer_ids = tribe_get_organizer_ids();
$multiple = count( $organizer_ids ) > 1;
$phone = tribe_get_organizer_phone();
$email = tribe_get_organizer_email();
$website = tribe_get_organizer_website_url();
?>
<div class="tribe-events-meta-group tribe-events-meta-group-organizer">
<h3 class="tribe-events-single-section-title"><?php echo tribe_get_organizer_label( ! $multiple ); ?></h3>
<dl>
<?php
do_action( 'tribe_events_single_meta_organizer_section_start' );
foreach ( $organizer_ids as $organizer ) {
if ( ! $organizer ) {
continue;
}
?>
<dt style="display:none;"><?php // This element is just to make sure we have a valid HTML ?></dt>
<dd class="tribe-organizer">
<?php echo tribe_get_organizer_link( $organizer ) ?>
</dd>
<?php
}
if ( ! $multiple ) { // only show organizer details if there is one
if ( ! empty( $phone ) ) {
?>
<dt>
<?php esc_html_e( 'Phone:', 'the-events-calendar' ) ?>
</dt>
<dd class="tribe-organizer-tel">
<?php echo esc_html( $phone ); ?>
</dd>
<?php
}//end if
if ( ! empty( $email ) ) {
?>
<dt>
<?php esc_html_e( 'Email:', 'the-events-calendar' ) ?>
</dt>
<dd class="tribe-organizer-email">
<?php echo esc_html( $email ); ?>
</dd>
<?php
}//end if
if ( ! empty( $website ) ) {
?>
<dt>
<?php esc_html_e( 'Website:', 'the-events-calendar' ) ?>
</dt>
<dd class="tribe-organizer-url">
<a href="<?php echo $website; ?>">View Website</a>
</dd>
<?php
}//end if
}//end if
do_action( 'tribe_events_single_meta_organizer_section_end' );
?>
</dl>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment