Example #1
0
 /**
  * Fetches the JSON-LD data for this type of object
  *
  * @param  int|WP_Post|null $post The post/organizer
  * @param  array  $args
  * @return array
  */
 public function get_data($post = null, $args = array('context' => false))
 {
     $data = parent::get_data($post, $args);
     // If we have an Empty data we just skip
     if (empty($data)) {
         return array();
     }
     // Fetch first key
     $post_id = key($data);
     // Fetch first Value
     $data = reset($data);
     $data->telephone = tribe_get_organizer_phone($post_id);
     $data->email = tribe_get_organizer_email($post_id);
     $data->sameAs = tribe_get_organizer_website_url($post_id);
     return array($post_id => $data);
 }
Example #2
0
<?php

/**
 * Single Event Meta (Organizer) Template
 *
 * Override this template in your own theme by creating a file at:
 * [your-theme]/tribe-events/modules/meta/details.php
 *
 * @package TribeEventsCalendar
 */
$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_link();
?>

<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 -->
	<h3 class="tribe-events-single-section-title">Instructor</h3>
	<dl>
		<?php 
do_action('tribe_events_single_meta_organizer_section_start');
foreach ($organizer_ids as $organizer) {
    if (!$organizer) {
        continue;
    }
    ?>
						<dd><?php 
        echo tribe_get_venue(get_the_ID(), true);
        ?>
</dd>
					</div>
				<?php 
    }
    ?>
				
				<?php 
    if (tribe_get_organizer_phone()) {
        ?>
				<div class="row">
					<dt>Phone:</dt>
					<dd><?php 
        echo tribe_get_organizer_phone();
        ?>
</dd>
				</div>
				<?php 
    }
    ?>
				
				<div class="row">
					<dt>Address:</dt>
					<dd><?php 
    echo tribe_get_address(get_the_ID());
    ?>
,  <?php 
    echo tribe_get_state(get_the_ID());
    ?>
Example #4
0
 /**
  * @deprecated
  */
 function sp_get_organizer_phone($postId = null)
 {
     _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_organizer_phone()');
     return tribe_get_organizer_phone($postId);
 }
 /**
  * Returns a summary of key information for the specified organizer.
  *
  * Typically this is a pipe separated format containing the organizer's telephone
  * number, email address and website where available.
  *
  * @param int $post_id
  *
  * @return string
  */
 function tribe_get_organizer_details($post_id = null)
 {
     $post_id = Tribe__Events__Main::postIdHelper($post_id);
     $organizer_id = (int) tribe_get_organizer_id($post_id);
     $details = array();
     if ($organizer_id && ($tel = tribe_get_organizer_phone())) {
         $details[] = '<span class="tel">' . $tel . '</span>';
     }
     if ($organizer_id && ($email = tribe_get_organizer_email())) {
         $details[] = '<span class="email"> <a href="mailto:' . esc_attr($email) . '">' . $email . '</a> </span>';
     }
     if ($organizer_id && ($link = tribe_get_organizer_website_link())) {
         $details[] = '<span class="link"> <a href="' . esc_attr($link) . '">' . $link . '</a> </span>';
     }
     $html = join('<span class="tribe-events-divider">|</span>', $details);
     if (!empty($html)) {
         $html = '<address class="organizer-address">' . $html . '</address>';
     }
     /**
      * Provides an opportunity to modify the organizer details HTML.
      *
      * @param string $html
      * @param int    $post_id
      * @param int    $organizer_id
      */
     return apply_filters('tribe_get_organizer_details', $html, $post_id, $organizer_id);
 }
Example #6
0
 *
 * This is ALSO used in the Organizer edit view. Be careful to test changes in both places.
 *
 * Override this template in your own theme by creating a file at
 * [your-theme]/tribe-events/community/modules/organizer.php
 *
 * @package TribeCommunityEvents
 * @since  2.1
 * @author Modern Tribe Inc.
 *
 */
if (!defined('ABSPATH')) {
    die('-1');
}
$organizer_name = esc_attr(tribe_get_organizer());
$organizer_phone = esc_attr(tribe_get_organizer_phone());
$organizer_website = esc_url(tribe_get_organizer_website_url());
$organizer_email = esc_attr(tribe_get_organizer_email());
if (!isset($event)) {
    $event = null;
}
?>

<!-- Organizer -->
<div class="tribe-events-community-details eventForm bubble" id="event_organizer">

	<table class="tribe-community-event-info" cellspacing="0" cellpadding="0">

		<tr>
			<td colspan="2" class="tribe_sectionheader">
				<h4><?php 
/**
 * Prints title organizer meta
 */
function grve_event_organizer_title_meta()
{
    $phone = tribe_get_organizer_phone();
    $email = tribe_get_organizer_email();
    $website = tribe_get_organizer_website_link();
    ob_start();
    if (!empty($phone) || !empty($email) || !empty($website)) {
        ?>
	<div class="grve-event-organizer-title-meta">
	<?php 
        if (!empty($phone)) {
            ?>
			<span class="tel"> <?php 
            echo $phone;
            ?>
 </span>
	<?php 
        }
        ?>

	<?php 
        if (!empty($email)) {
            ?>
			<span class="email"> <?php 
            echo $email;
            ?>
 </span>
	<?php 
        }
        ?>

	<?php 
        if (!empty($website)) {
            ?>
			<span class="url"> <?php 
            echo $website;
            ?>
 </span>
	<?php 
        }
        ?>
	</div>
<?php 
    }
    return ob_get_clean();
}