/** * Region * * Returns the state or province for US or non-US addresses (effectively the same thing as tribe_get_stateprovince()) * * @param int $postId Can supply either event id or venue id, if none specified, current post is used * * @return string * @todo Depricate tribe_get_region or tribe_get_stateprovince */ function tribe_get_region($postId = null) { $postId = tribe_get_venue_id($postId); if (tribe_get_event_meta($postId, '_VenueStateProvince', true)) { $region = tribe_get_event_meta($postId, '_VenueStateProvince', true); } else { if (tribe_get_country($postId) == __('United States', 'tribe-events-calendar')) { $region = tribe_get_state($postId); } else { $region = tribe_get_province(); } } return apply_filters('tribe_get_region', $region); }
* Override this template in your own theme by creating a file at * [your-theme]/tribe-events/community/modules/venue.php * * @package TribeCommunityEvents * @since 2.1 * @author Modern Tribe Inc. * */ if (!defined('ABSPATH')) { die('-1'); } $venue_name = tribe_get_venue(); $venue_phone = tribe_get_phone(); $venue_address = tribe_get_address(); $venue_city = tribe_get_city(); $venue_province = tribe_get_province(); $venue_state = tribe_get_state(); $venue_country = tribe_get_country(); $venue_zip = tribe_get_zip(); if (!tribe_get_venue_id() && tribe_get_option('defaultValueReplace')) { $venue_phone = empty($venue_phone) ? tribe_get_option('eventsDefaultPhone') : $venue_phone; $venue_address = empty($venue_address) ? tribe_get_option('eventsDefaultAddress') : $venue_address; $venue_city = empty($venue_city) ? tribe_get_option('eventsDefaultCity') : $venue_city; $venue_state = empty($venue_state) ? tribe_get_option('eventsDefaultState') : $venue_state; $venue_province = empty($venue_province) ? tribe_get_option('eventsDefaultProvince') : $venue_province; $venue_country = empty($venue_country) ? tribe_get_option('defaultCountry') : $venue_country; $venue_zip = empty($venue_zip) ? tribe_get_option('eventsDefaultZip') : $venue_zip; } if (!isset($event)) { $event = null; }
/** * @deprecated */ function sp_get_province($postId = null) { _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_province()'); return tribe_get_province($postId); }
/** * Process event calendar tags */ private function process_the_events_calendar_tags($content) { if (!function_exists('tribe_get_start_date')) { return $content; } // The Events Calendar $event_date_format = get_option('date_format'); $event_time_format = get_option('time_format'); $event_all_day = get_post_meta(get_the_ID(), '_EventAllDay', true); $event_start_date = tribe_get_start_date(get_the_ID(), false, $event_date_format); $event_start_time = tribe_get_start_date(get_the_ID(), false, $event_time_format); $event_end_date = tribe_get_end_date(get_the_ID(), false, $event_date_format); $event_end_time = tribe_get_end_date(get_the_ID(), false, $event_time_format); $separator = apply_filters("metaslider_tribe_separator", " - "); if ($event_all_day) { if ($event_start_date == $event_end_date) { $event_string = $event_start_date; } else { $event_string = $event_start_date . $separator . $event_end_date; } } else { if ($event_start_date == $event_end_date) { $event_string = $event_start_date . " " . $event_start_time . $separator . $event_end_time; } else { $event_string = $event_start_date . $separator . $event_end_date; } } $content = str_replace("{event_date}", $event_string, $content); $content = str_replace("{event_start_date}", $event_start_date, $content); $content = str_replace("{event_start_time}", $event_start_time, $content); $content = str_replace("{event_end_time}", $event_end_time, $content); $content = str_replace("{event_end_date}", $event_end_date, $content); $content = str_replace("{event_address}", tribe_get_address(get_the_ID()), $content); $content = str_replace("{event_city}", tribe_get_city(get_the_ID()), $content); $content = str_replace("{event_country}", tribe_get_country(get_the_ID()), $content); $content = str_replace("{event_full_address}", tribe_get_full_address(get_the_ID()), $content); $content = str_replace("{event_phone}", tribe_get_phone(get_the_ID()), $content); $content = str_replace("{event_province}", tribe_get_province(get_the_ID()), $content); $content = str_replace("{event_region}", tribe_get_region(get_the_ID()), $content); $content = str_replace("{event_state}", tribe_get_state(get_the_ID()), $content); $content = str_replace("{event_stateprovince}", tribe_get_stateprovince(get_the_ID()), $content); $content = str_replace("{event_venue}", tribe_get_venue(get_the_ID()), $content); $content = str_replace("{event_venue_id}", tribe_get_venue_id(get_the_ID()), $content); $content = str_replace("{event_venue_link}", tribe_get_venue_link(get_the_ID(), false), $content); $content = str_replace("{event_zip}", tribe_get_zip(get_the_ID()), $content); return $content; }