/** * Event Website Link (more info) * * @param null|object|int $event * @param null|string $label * @return string $html */ function tribe_get_event_website_link($event = null, $label = null) { $url = tribe_get_event_website_url($event); if (!empty($url)) { $label = is_null($label) ? $url : $label; $html = sprintf('<a href="%s" target="%s">%s</a>', $url, apply_filters('tribe_get_event_website_link_target', 'self'), apply_filters('tribe_get_event_website_link_label', $label)); } else { $html = ''; } return apply_filters('tribe_get_event_website_link', $html); }
</dd> <?php } ?> <?php // Event Cost if (!empty($cost)) { ?> <dt> <?php esc_html_e('Cost:', 'the-events-calendar'); ?> </dt> <dd class="tribe-events-event-cost" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="USD" /> <meta itemprop="url" class="u-url" content="<?php echo tribe_get_event_website_url($event); ?> " /> <meta itemprop="price" content="<?php echo tribe_get_cost(null, false); ?> " /> <!-- <meta itemprop="availability" content="" /> <meta itemprop="category" content="" /> <meta itemprop="validFrom" content="" /> <meta itemprop="validThrough" content="" /> --> <span><?php echo tribe_get_cost(null, true); ?>
/** * Event title link to repertoire page */ function tribe_set_link_website($link, $postId) { $website_url = tribe_get_event_website_url($postId); // Only swaps link if set if (!empty($website_url)) { $link = $website_url; } return $link; }
/** * Event Submission Form Website Block * Renders the website fields in the submission form. * * Override this template in your own theme by creating a file at * [your-theme]/tribe-events/community/modules/website.php * * @package TribeCommunityEvents * @since 3.1 * @author Modern Tribe Inc. * */ if (!defined('ABSPATH')) { die('-1'); } $event_url = function_exists('tribe_get_event_website_url') ? tribe_get_event_website_url() : tribe_community_get_event_website_url(); ?> <!-- Event Website --> <?php do_action('tribe_events_community_before_the_website'); ?> <div class="tribe-events-community-details eventForm bubble" id="event_cost"> <table class="tribe-community-event-info" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" class="tribe_sectionheader"> <h4><?php _e('Event Website', 'tribe-events-calendar');
/** * Event Website URL * * @param null|object|int $event * @return string The event's website URL * @deprecated use tribe_get_event_website_url() * * This function was added for compatibility reasons. It can be removed once * tribe_get_event_website_url() is in the required version of core * -- jbrinley (2013-09-16) */ function tribe_community_get_event_website_url($event = null) { if (function_exists('tribe_get_event_website_url')) { return tribe_get_event_website_url(); } $post_id = is_object($event) && isset($event->tribe_is_event) && $event->tribe_is_event ? $event->ID : $event; $post_id = !empty($post_id) || empty($GLOBALS['post']) ? $post_id : get_the_ID(); $url = tribe_get_event_meta($post_id, '_EventURL', true); if (!empty($url)) { $parseUrl = parse_url($url); if (empty($parseUrl['scheme'])) { $url = "http://{$url}"; } } return apply_filters('tribe_get_event_website_url', $url, $post_id); }
?> </div> </div> <?php } ?> <!-- .tribe-events-event-meta --> <!-- Event Title --> <?php do_action('tribe_events_before_the_event_title'); ?> <h2 class="tribe-events-list-event-title entry-title summary"> <a class="url" href="<?php echo esc_url(tribe_get_event_website_url()); ?> " title="<?php the_title_attribute(); ?> " rel="bookmark"> <?php the_title(); ?> </a> </h2> <?php do_action('tribe_events_after_the_event_title'); ?>