本文整理汇总了PHP中tribe_get_city函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_city函数的具体用法?PHP tribe_get_city怎么用?PHP tribe_get_city使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_city函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate_attendees_PDF
public final function generate_attendees_PDF($tickets_list)
{
$this->load_pdf_libraries();
$pdf = new FPDF();
$ecp = TribeEvents::instance();
$pdf->AddFont('OpenSans', '', 'opensans.php');
$pdf->AddFont('SteelFish', '', 'steelfish.php');
$pdf->SetTitle('EventTicket');
$pdf->SetAuthor('The Events Calendar');
$pdf->SetCreator('The Events Calendar');
$defaults = array('event_id' => 0, 'ticket_name' => '', 'holder_name' => '', 'order_id' => '', 'ticket_id' => '', 'security_code' => '');
foreach ($tickets_list as $ticket) {
$ticket = wp_parse_args($ticket, $defaults);
$event = get_post($ticket['event_id']);
$venue_id = tribe_get_venue_id($event->ID);
$venue = !empty($venue_id) ? get_post($venue_id)->post_title : '';
$address = tribe_get_address($event->ID);
$zip = tribe_get_zip($event->ID);
$state = tribe_get_stateprovince($event->ID);
$city = tribe_get_city($event->ID);
$pdf->AddPage();
$pdf->SetDrawColor(28, 166, 205);
$pdf->SetFillColor(28, 166, 205);
$pdf->Rect(15, 10, 180, 34, 'F');
$pdf->SetTextColor(255);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 15);
$pdf->Write(5, __('EVENT NAME:', 'tribe-events-calendar'));
$pdf->SetXY(30, 28);
$pdf->SetFont('SteelFish', '', 53);
$title = strtoupper(utf8_decode($event->post_title));
$size = 53;
while ($pdf->GetStringWidth($title) > 151) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $title);
$pdf->SetTextColor(41);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 50);
$pdf->Write(5, __('TICKET HOLDER:', 'tribe-events-calendar'));
$pdf->SetXY(104, 50);
$pdf->Write(5, __('LOCATION:', 'tribe-events-calendar'));
$pdf->SetFont('SteelFish', '', 30);
$pdf->SetXY(30, 59);
$holder = strtoupper(utf8_decode($ticket['holder_name']));
$size = 30;
while ($pdf->GetStringWidth($holder) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $holder);
$pdf->SetXY(104, 59);
$venue = strtoupper(utf8_decode($venue));
$size = 30;
while ($pdf->GetStringWidth($venue) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $venue);
$pdf->SetXY(104, 71);
$address = strtoupper(utf8_decode($address));
$size = 30;
while ($pdf->GetStringWidth($address) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $address);
$pdf->SetXY(104, 83);
$address2 = array($city, $state, $zip);
$address2 = array_filter($address2);
$address2 = join(', ', $address2);
$address2 = strtoupper(utf8_decode($address2));
$size = 30;
while ($pdf->GetStringWidth($address2) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $address2);
$pdf->Line(15, 97, 195, 97);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 105);
$pdf->Write(5, __('ORDER:', 'tribe-events-calendar'));
$pdf->SetXY(80, 105);
$pdf->Write(5, __('TICKET:', 'tribe-events-calendar'));
$pdf->SetXY(120, 105);
$pdf->Write(5, __('VERIFICATION:', 'tribe-events-calendar'));
$pdf->SetFont('SteelFish', '', 53);
$pdf->SetXY(30, 118);
$pdf->Write(5, $ticket['order_id']);
$pdf->SetXY(80, 118);
$pdf->Write(5, $ticket['ticket_id']);
$pdf->SetXY(120, 118);
$pdf->Write(5, $ticket['security_code']);
$pdf->Rect(15, 135, 180, 15, 'F');
$pdf->SetTextColor(255);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 140);
$pdf->Write(5, get_bloginfo('name'));
$pdf->SetXY(104, 140);
//.........这里部分代码省略.........
示例2: block_tribe_event_output
function block_tribe_event_output($params)
{
extract($params);
$default_excerpt_length = 650;
if (!isset($event_ID) || empty($event_ID)) {
return;
}
$event = get_post($event_ID);
// if block has event ID but the actual event does not exist then exit
if (!isset($event)) {
return;
}
// BLOCK CLASSES
$block_classes = "outter-wrapper";
if (!empty($custom_classes)) {
$block_classes .= " " . $custom_classes;
}
?>
<!-- BLOCK: LATEST POSTS-->
<!-- start outter-wrapper -->
<div <?php
pb_block_id_class($block_classes, $params);
?>
>
<!-- block styles -->
<style type="text/css" scoped>
<?php
include 'includes/inc_block_output_style.php';
?>
</style>
<!-- start main-container -->
<div class="main-container">
<!-- start main wrapper -->
<div class="main wrapper clearfix">
<!-- start main-content -->
<div class="main-content">
<!-- Start Post -->
<div class="clearfix tribe-events-tcblock">
<!-- Event Cost -->
<div class="tribe-events-event-cost">
<span><?php
echo tribe_get_formatted_cost($event_ID);
?>
</span>
</div>
<!-- Event Title -->
<h2 class="tribe-events-list-event-title summary">
<?php
printf('<a class="url" href="%s" title="%s" rel="bookmark">%s</a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(get_the_title($event_ID)), esc_attr(get_the_title($event_ID)));
?>
</h2>
<!-- Event Image -->
<div class="tribe-events-event-image">
<?php
if (has_post_thumbnail($event_ID) && get_post(get_post_thumbnail_id($event_ID))) {
$post_thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($event_ID), 'full');
printf('<a href="%s" title="%s"><img src="%s" title="%s"/></a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(get_the_title($event_ID)), esc_url($post_thumbnail_src[0]), esc_attr(get_the_title($event_ID)));
}
?>
</div>
<!-- Event Meta -->
<div class="tribe-events-event-meta vcard location">
<!-- Schedule & Recurrence Details -->
<div class="updated published time-details">
<?php
printf('<span class="date-start dtstart">%s</span>', esc_attr(tribe_get_start_date($event_ID)));
?>
</div>
<!-- Venue Display Info -->
<div class="tribe-events-venue-details">
<span class="author fn org"><?php
echo tribe_get_venue($event_ID);
?>
</span>,
<address class="tribe-events-address">
<span class="adr">
<span class="street-address"><?php
echo tribe_get_address($event_ID);
?>
</span>
<span class="delimiter">,</span>
<span class="locality"><?php
echo tribe_get_city($event_ID);
?>
</span>
//.........这里部分代码省略.........
示例3: get_data
/**
* Fetches the JSON-LD data for this type of object
*
* @param int|WP_Post|null $post The post/venue
* @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->address = array();
$data->address['streetAddress'] = tribe_get_address($post_id);
$data->address['addressLocality'] = tribe_get_city($post_id);
$data->address['addressRegion'] = tribe_get_region($post_id);
$data->address['postalCode'] = tribe_get_zip($post_id);
$data->address['addressCountry'] = tribe_get_country($post_id);
// Filter empty entries and convert to object
$data->address = (object) array_filter($data->address);
$geo = tribe_get_coordinates($post_id);
if (!empty($geo['lat']) && !empty($geo['lng'])) {
$data->geo = (object) array('@type' => 'GeoCoordinates', 'latitude' => $geo['lat'], 'longitude' => $geo['lng']);
}
$data->telephone = tribe_get_phone($post_id);
$data->sameAs = tribe_get_venue_website_url($post_id);
return array($post_id => $data);
}
示例4: get_api_meta_data
/**
* Retrieve the data to use when returning an event through the REST API.
*
* @param $object
* @param $field
* @param $request
*
* @return string
*/
public function get_api_meta_data($object, $field, $request)
{
if ('event_city' === $field) {
return esc_html(tribe_get_city($object['id']));
}
if ('event_state' === $field) {
return esc_html(tribe_get_state($object['id']));
}
if ('event_venue' === $field) {
return esc_html(tribe_get_venue($object['id']));
}
if ('start_date' === $field) {
return esc_html(get_post_meta($object['id'], '_EventStartDate', true));
}
if ('end_date' === $field) {
return esc_html(get_post_meta($object['id'], '_EventEndDate', true));
}
return '';
}
示例5: tribe_address_exists
/**
* Address Test
*
* Returns true if any of the following exist: address, city, state/province (region), country or zip
*
* @param int $postId Can supply either event id or venue id, if none specified, current post is used
*
* @return bool True if any part of an address exists
*/
function tribe_address_exists($postId = null)
{
if (tribe_get_address($postId) || tribe_get_city($postId) || tribe_get_region($postId) || tribe_get_country($postId) || tribe_get_zip($postId)) {
return true;
} else {
return false;
}
}
示例6: tribe_get_city
}
?>
<?php
}
?>
<?php
// This locations's city.
if (tribe_get_city($venue_id)) {
if (tribe_get_address($venue_id)) {
?>
<?php
}
?>
<span class="locality"><?php
echo tribe_get_city($venue_id);
?>
</span><span class="delimiter">,</span>
<?php
}
?>
<?php
// This location's abbreviated region. Full region name in the element title.
if (tribe_get_region($venue_id)) {
?>
<abbr class="region tribe-events-abbr" title="<?php
esc_attr_e($full_region);
?>
"><?php
echo tribe_get_region($venue_id);
示例7: die
*
* 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;
示例8: hatch_tribe_event_featured_image
" class="hatching-block">
<div class="block-wrapper">
<div class="hatching-block-img" style="background-image:url('<?php
echo hatch_tribe_event_featured_image();
?>
');"></div>
<h1 class="hatching-title"><?php
the_title();
?>
</h1>
<span class="hatching-date"><?php
echo tribe_get_start_date();
?>
</span>
<span class="hatching-location"><?php
echo tribe_get_city();
?>
, <?php
echo tribe_get_stateprovince();
?>
</span>
</div>
</a>
<?php
}
?>
</div>
</section>
<!-- Partners -->
示例9: foreach
<div class="slide">
<dl>
<dt>TYPE:</dt>
<?php
foreach ($categories as $category) {
?>
<dd><?php
echo str_replace('</li>', '', $category);
?>
</dd>
<?php
}
?>
<dt>LOCATION:</dt>
<dd><?php
echo tribe_get_city($post->ID);
?>
, <?php
echo tribe_get_state($post->ID);
?>
</dd>
</dl>
<dl>
<?php
if (!empty($event_link)) {
?>
<dt>WEBSITE:</dt>
<dd><?php
echo $event_link;
?>
</dd>
示例10: tribe_address_exists
/**
* Address Test
*
* Returns true if any of the following exist: address, city, state/province (region), country or zip
*
* @param int $postId Can supply either event id or venue id, if none specified, current post is used
*
* @return bool True if any part of an address exists
*/
function tribe_address_exists($postId = null)
{
if (tribe_get_address($postId) || tribe_get_city($postId) || tribe_get_region($postId) || tribe_get_country($postId) || tribe_get_zip($postId) || tribe_is_venue_overwrite($postId) && tribe_get_coordinates($postId)) {
return true;
} else {
return false;
}
}
示例11: tribe_get_venue_single_line_address
/**
* Gets the venue name and address on a single line
*
* @param int $event_id Event ID
* @param boolean $link Whether or not to wrap the text in a venue link
*
* @return string
*/
function tribe_get_venue_single_line_address($event_id, $link = true)
{
$venue = null;
if (tribe_has_venue($event_id)) {
$venue_id = tribe_get_venue_id($event_id);
$venue_name = tribe_get_venue($event_id);
$venue_url = tribe_get_venue_link($event_id, false);
$venue_address = array('city' => tribe_get_city($event_id), 'stateprovince' => tribe_get_stateprovince($event_id), 'zip' => tribe_get_zip($event_id));
/**
* Filters the parts of a venue address
*
* @var array Array of address parts
* @var int Event ID
*/
$venue_address = apply_filters('tribe_events_venue_single_line_address_parts', $venue_address, $event_id);
// get rid of blank elements
$venue_address = array_filter($venue_address);
$venue = $venue_name;
$separator = _x(', ', 'Address separator', 'the-events-calendar');
if ($venue_address) {
$venue .= $separator . implode($separator, $venue_address);
}
if ($link && $venue_url) {
$attr_title = the_title_attribute(array('post' => $venue_id, 'echo' => false));
$venue = '<a href="' . esc_url($venue_url) . '" title="' . $attr_title . '">' . $venue . '</a>';
}
}
/**
* Filters the venue single-line address
*
* @var string Venue address line
* @var int Event ID
* @var boolean Whether or not the venue should be linked
*/
return apply_filters('tribe_events_get_venue_single_line_address', $venue, $event_id, $link);
}
示例12: tribe_get_start_date
?>
</a>
</div>
<div class="when">
<?php
echo tribe_get_start_date($post->ID, isset($start) ? $start : null);
if ($event->AllDay && isset($start) && $start) {
echo ' <small>(' . __('All Day', 'tribe-events-calendar-pro') . ')</small>';
}
?>
</div>
<div class="loc">
<?php
if (tribe_get_city() != '') {
echo tribe_get_city() . ', ';
}
if (tribe_get_region() != '') {
echo tribe_get_region() . ', ';
}
if (tribe_get_country() != '') {
echo tribe_get_country();
}
?>
</div>
<div class="event_body">
<?php
$content = apply_filters('the_content', strip_shortcodes($post->post_content));
$content = str_replace(']]>', ']]>', $content);
echo wp_trim_words($content, apply_filters('excerpt_length', 55), apply_filters('excerpt_more', ' ' . '[...]'));
?>
示例13: tribe_get_address
<?php
// Get our street address
if (tribe_get_address($postId)) {
$address_out[] = '<span class="street-address">' . tribe_get_address($postId) . '</span>';
if (!tribe_is_venue()) {
$address_out[] = '<span class="delimiter">,</span> ';
}
}
// Get our full region
$our_province = tribe_get_event_meta($postId, '_VenueStateProvince', true);
$our_states = TribeEventsViewHelpers::loadStates();
$our_full_region = isset($our_states[$our_province]) ? $our_states[$our_province] : $our_province;
// Get our city
if (tribe_get_city($postId)) {
$address_out[] = ' <span class="locality">' . tribe_get_city($postId) . '</span>';
$address_out[] = '<span class="delimiter">,</span> ';
}
// Get our region
if (tribe_get_region($postId)) {
if (count($address_out)) {
$address_out[] = ' <abbr class="region tribe-events-abbr" title="' . $our_full_region . '">' . tribe_get_region($postId) . '</abbr>';
}
}
// Get our postal code
if (tribe_get_zip($postId)) {
$address_out[] = ' <span class="postal-code">' . tribe_get_zip($postId) . '</span>';
}
// Get our country
if (tribe_get_country($postId)) {
if (count($address_out)) {
示例14: tribe_get_address
?>
<?php
if (tribe_get_address($postId)) {
?>
<?php
$address_out[] = '<span itemprop="streetAddress">' . tribe_get_address($postId) . '</span>';
?>
<?php
}
?>
<?php
$cityregion = '';
if (tribe_get_city($postId)) {
$cityregion .= tribe_get_city($postId);
}
if (tribe_get_region($postId)) {
if ($cityregion != '') {
$cityregion .= ', ';
}
$cityregion .= tribe_get_region($postId);
}
if ($cityregion != '') {
?>
<?php
$address_out[] = '<span itemprop="addressRegion">' . $cityregion . '</span>';
?>
<?php
}
?>
示例15: sp_get_city
/**
* @deprecated
*/
function sp_get_city($postId = null)
{
_deprecated_function(__FUNCTION__, '2.0', 'tribe_get_city()');
return tribe_get_city($postId);
}